简体   繁体   English

iOS 8.3 UiAlertView关闭苹果键盘

[英]iOS 8.3 UiAlertView close apple keyboard

I upgraded my iPhone version from 8.2 to 8.3 today and saw that apple changed the keyboard behaviour. 我今天将iPhone的版本从8.2升级到8.3,看到苹果改变了键盘行为。 when I show UIAlertVIew the keyboard close automatically. 当我显示UIAlertVIew键盘自动关闭时。

I need to keep the keyboard open. 我需要保持键盘打开。 Is that possible? 那可能吗?

To workaround this bug in iOS 8. 在iOS 8中解决此错误。

Whenever you dismiss your alert by clicking any button just call [textfield becomeFirstResponder] . 每当您通过单击任何按钮关闭警报时,只需调用[textfield becomeFirstResponder] It will open the keyboard. 它会打开键盘。

Or you can call [textfield becomeFirstResponder] after you do [alert show] . 或者,您可以在执行[alert show]后调用[textfield becomeFirstResponder] [alert show]

If you want the keyboard to be open after showing the alert, just use the following code: 如果您希望在显示警报后打开键盘,只需使用以下代码:

Swift: 迅速:

alert.show()
text1.becomeFirstResponder()

Objective-C: Objective-C的:

[alert show];
[text1 becomeFirstResponder];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM