[英]How to add toolbar above iOS8 custom keyboard?
我的問題是寫圖片。 我真的需要你的幫助 也許可以使用inputAccessoryView,inputAccessoryViwController,但我真的不知道。 非常感謝!
您可以使用“自動布局”來調整自定義鍵盤的主視圖的高度。 默認情況下,將根據屏幕大小和設備方向調整自定義鍵盤的大小以匹配系統鍵盤。 系統始終將自定義鍵盤的寬度設置為等於當前屏幕的寬度。 要調整自定義鍵盤的高度,請更改其主視圖的高度約束。
以下代碼行顯示了如何定義和添加這樣的約束:
CGFloat _expandedHeight = 500;
NSLayoutConstraint *_heightConstraint =
[NSLayoutConstraint constraintWithItem: self.view
attribute: NSLayoutAttributeHeight
relatedBy: NSLayoutRelationEqual
toItem: nil
attribute: NSLayoutAttributeNotAnAttribute
multiplier: 0.0
constant: _expandedHeight];
[self.view addConstraint: _heightConstraint];
資料來源: https : //developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Keyboard.html
將代碼添加到viewDidAppear / viewWillAppear
將欄添加到額外的空間。 您不能使背景透明。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.