Custom keyboard height is more than default keybaord

会有一股神秘感。 提交于 2019-12-02 04:12:41

You should look at the inputAccessoryView property. Since it is a property on UIResponder, it is available on UITextView, UITextField and others. Assigning your custom view to inputAccessoryView will make it appear on top of the keyboard whenever the UI object you assigned it to has focus.

// Create your custom keyboard accessory view first
// then assign it
yourTextField.inputAccessoryView = yourCustomAccessoryView;

// Bring up keyboard and your accessory view
[yourTextField becomeFirstResponder];

Read more here https://developer.apple.com/library/content/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/InputViews/InputViews.html

inputAccessoryView
Assigning a view to this property causes that view to be displayed above the standard system keyboard (or above the custom input view if one is provided) when the text view becomes the first responder. For example, you could use this property to attach a custom toolbar to the keyboard.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!