のヘルプが必要です私はこの1つGitHub of My First Custom Keyboard、カスタムキーボードを作る:は、カスタムキーボード
が、それは非常にタイトに見えます。
私はそれを大きくするための方法を検索しましたし、私はそれが私のカスタムキーボード上では動作しません
var heightConstraint: NSLayoutConstraint!
override func updateViewConstraints() {
super.updateViewConstraints()
let customHeight = UIScreen.main.bounds.height/2
if heightConstraint == nil {
heightConstraint = NSLayoutConstraint(item: view,
attribute: .height,
relatedBy: .equal,
toItem: nil,
attribute: .notAnAttribute,
multiplier: 1,
constant: customHeight)
heightConstraint.priority = UILayoutPriority(UILayoutPriorityRequired)
print("Setuped")
view.addConstraint(heightConstraint)
}
else {
print("2")
heightConstraint.constant = customHeight
}
}
しかし、何もそれほど起こらない私は、このQuestion
リンクから作られた大きなカスタムキーボードをダウンロードしていることがわかりました:GitHub of Downloaded Keyboard:
このキーボードは完璧な高さを持っているが、私は彼がもう動作しないボタンを追加するとき:/ GitHub of Edited by me Downloaded Keyboard
誰かが私の最初のカスタムキーボードの背を高くしたり、ダウンロードしたキーボードにボタンを追加したりすることができます。
カスタムキーボードビューでは、translatesAutoResizingMaskToConstraints = NOを設定してみてください。 – Brandon
@Brandonも何も起こらない:/ – Rombond