iPhone UISearchBar& keyboardAppearance [英] iPhone UISearchBar & keyboardAppearance
本文介绍了iPhone UISearchBar& keyboardAppearance的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当键盘出现时,我想设置
When the keyboard appears, I want to set the
keyboardAppearance = UIKeyboardAppearanceAlert
我检查了文档,看起来你只能更改keyboardType。
I've checked the documentation and it looks like you can only change the keyboardType.
这可以在不违反任何Apple私有API的情况下完成吗?
Can this be done without violating any of Apple's private API's ?
推荐答案
我发现这样做的最好方法,如果你想要在整个应用程序中执行此操作,就是在UITextField上使用Appearance。在发布时将其放入AppDelegate。
The best way that I found to do this, if you want to do it throughout your app, is to use Appearance on UITextField. Put this in your AppDelegate on launch.
[[UITextField appearance] setKeyboardAppearance:UIKeyboardAppearanceDark];
这篇关于iPhone UISearchBar& keyboardAppearance的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文