カスタムキーボードを下記のホームページのように作成しました。
https://qiita.com/chibi929/items/a1b03c21fecc502c81b2
ですが下記の画像の通りになってしまいます。
■シュミレーター
→変更後
swift
1import UIKit 2 3class KeyboardViewController: UIInputViewController { 4 5 @IBOutlet var nextKeyboardButton: UIButton! 6 7 override func updateViewConstraints() { 8 super.updateViewConstraints() 9 10 // Add custom view sizing constraints here 11 } 12 13 override func viewDidLoad() { 14 super.viewDidLoad() 15 let heightConstraint = NSLayoutConstraint( 16 item: self.view, 17 attribute: NSLayoutConstraint.Attribute.height, 18 relatedBy: NSLayoutConstraint.Relation.equal, 19 toItem: nil, 20 attribute: NSLayoutConstraint.Attribute.notAnAttribute, 21 multiplier: 0.0, 22 constant: 400) 23 24 var v = UINib(nibName:"KeyboardView", bundle:nil).instantiate(withOwner: self,options:nil)[0] as! UIView 25 self.inputView?.addSubview(v) 26 self.view.addConstraint(heightConstraint) 27 } 28 29 override func didReceiveMemoryWarning() { 30 super.didReceiveMemoryWarning() 31 // Dispose of any resources that can be recreated 32 } 33 34 override func textWillChange(_ textInput: UITextInput?) { 35 // The app is about to change the document's contents. Perform any preparation here. 36 } 37 38 override func textDidChange(_ textInput: UITextInput?) { 39 // The app has just changed the document's contents, the document context has been updated. 40 } 41 @IBAction func buttonNext(sender: AnyObject) { 42 self.advanceToNextInputMode() 43 } 44 45} 46
どのようにしたら高さが適用できるのでしょうか?
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/02 07:21
2018/11/02 07:21
2018/11/02 07:27
2018/11/02 07:36
2018/11/02 07:36
2018/11/02 07:37
2018/11/02 07:46
2018/11/02 07:54
2018/11/02 08:03 編集
2018/11/02 08:26