如何设置仅针对UItextfield的自定义键盘 [英] How to set Custom keyboard specific to only a UItextfield

查看:127
本文介绍了如何设置仅针对UItextfield的自定义键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置仅针对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];

中的

.但是转到该UIView之后,其他UIViewController中的键盘也看起来像新的自定义键盘.如何将自定义键盘限制为仅一个UIView?请帮我.预先感谢.

in a UIViewController. But after going to that UIView, keyboards in other UIViewControllers also look like new custom keyboard. How can i limit the custom keyboard to only one UIView? Please help me. Thanks in advance.

推荐答案

我的问题是曾经加载自定义键盘,它仍然存在于应用程序的其他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..

    for(UIView* keyboardToolbar in [keyboard subviews]){
        if([[keyboardToolbar description] hasPrefix:@"<UIToolbar"] == YES)
            {
                [keyboardToolbar removeFromSuperview];      
            }
    }

这篇关于如何设置仅针对UItextfield的自定义键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆