我正在为我的应用程序使用iOS 7。在我的应用程序中,我将键盘外观更改为'UIkeyboardApperanceAlert
'。它使键盘变黑。但问题是,当应用程序从背景到前景,每当我点击textField
它首先打开白色的键盘,然后它的颜色变成黑色。ios 7键盘问题
为什么会发生这种情况?任何帮助表示赞赏,请回复。
我正在为我的应用程序使用iOS 7。在我的应用程序中,我将键盘外观更改为'UIkeyboardApperanceAlert
'。它使键盘变黑。但问题是,当应用程序从背景到前景,每当我点击textField
它首先打开白色的键盘,然后它的颜色变成黑色。ios 7键盘问题
为什么会发生这种情况?任何帮助表示赞赏,请回复。
我发现autocorrectionType
属性设置为UITextAutocorrectionTypeNo
解决了这个问题!
self.myTextField.autocorrectionType = UITextAutocorrectionTypeNo;
UIKeyboardAppearanceAlert在ios7中已弃用。改用UIKeyboardAppearanceDark。
hi.thanks很快回复,但UIKeyboardAppearanceAlert不被弃用,并根据你的建议,我已经尝试了黑暗,但它仍然是从白色变为黑色时,应用程序从背景到前景第一次。 – nikBhosale
这是depreciated.open UITextInputTraits苹果文档,并参见UIKeyboardAppearance.https://developer.apple.com/library/ios/documentation/uikit/reference/UITextInputTraits_Protocol/Reference/UITextInputTraits.html – santhu
您好santhu检查上面的链接,I错了。但即使现在我使用uiKeyboardAppearanceDark它仍然会给出同样的问题 – nikBhosale
试试这个:
在您的viewDidLoad/viewDidAppear添加这个(分配和ofcourse初始化后):
[(的UITextField *)yourSubView setKeyboardAppearance:UIKeyboardAppearanceAlert]。
或者
[yourTextField setKeyboardAppearance:UIKeyboardAppearanceAlert];
嘿乔尝试了你的建议,但没有成功。它只发生在应用程序从后台到前台以及第一次时。 – nikBhosale
这是iOS 7中的一个错误,我对Apple开发论坛有反馈意见。
请与我们分享一些代码 – nivritgupta
您好,感谢的答复, textField.keyboardAppearance = UIKeyboardAppearanceAlert;这是我用来更改键盘颜色的代码。 – nikBhosale
重复此:http://stackoverflow.com/questions/19258765/ios-7-keyboard-color-flash这是一个在iOS 7中的错误,我对苹果开发论坛的反馈 – Woodstock