如何设置仅针对UItextfield的自定义键盘 [英] How to set Custom keyboard specific to only a UItextfield
问题描述
How to set Custom keyboard specific to only a UITextField
? When I am changing using this method, all the keyboards in my application are changed to this new custom keyboard. I added:
[[NSNotificationCenter defaultCenter] addObserver:self.view
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
.但是转到该 in a 我的问题是曾经加载自定义键盘,它仍然存在于应用程序的其他UIview中的任何地方.所以我检查了其他UIkeyboard子视图中是否存在UIToolbar并删除了它.现在可以正常工作了. My problem was once am loading custom keyboard, it remains everywhere in other UIviews of application. So i checked existence of UIToolbar in other UIkeyboard subviews and removed . Now its working fine.. 这篇关于如何设置仅针对UItextfield的自定义键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!UIView
之后,其他UIViewController
中的键盘也看起来像新的自定义键盘.如何将自定义键盘限制为仅一个UIView
?请帮我.预先感谢.UIViewController
. But after going to that UIView
, keyboards in other UIViewController
s also look like new custom keyboard. How can i limit the custom keyboard to only one UIView
? Please help me. Thanks in advance.推荐答案
for(UIView* keyboardToolbar in [keyboard subviews]){
if([[keyboardToolbar description] hasPrefix:@"<UIToolbar"] == YES)
{
[keyboardToolbar removeFromSuperview];
}
}