防止在按下UITextField时显示默认键盘 [英] Prevent default keyboard from showing when UITextField is pressed
问题描述
有一种方法让自定义键盘在用户按下UITextField时弹出。我有一个视图与自定义键盘上,我想要当用户按下UITextField而不是默认苹果键盘时出现。
Is there a way to make a custom keyboard to pop up when a user presses on a UITextField. I have a view with a custom keypad on it and I want that to come up when the user presses on the UITextField instead of the default apple keyboard.
推荐答案
因为iOS 3.2有一个称为inputView的属性。
Since iOS 3.2 there's a property for exactly that, called inputView.
只是这样:[myTextField setInputView:myInputView] - 其中myInputView显然是您的自定义输入视图。然后系统将弹出您的视图,而不是预定义的键盘。
just go like this: [myTextField setInputView:myInputView] - where myInputView is obviously your custom input view. Then the system will pop up your view instead of the predefined keyboards.
这篇关于防止在按下UITextField时显示默认键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!