iOS 8键盘在解除模态视图控制器后解除延迟 [英] iOS 8 Keyboard Dismissed delay after modal view controller is dismissed
问题描述
在iOS 8+中,我注意到如果你在一个视图控制器中有一个文本字段,当前是 firstResponder
,当视图控制器被解除时,键盘在被解雇之前,它会持续约1秒钟。
In iOS 8+ I noticed that if you have an textfield that is currently the firstResponder
in a view controller that was presented, when the view controller is dismissed, the keyboard hangs around for around 1 second before being dismissed.
iOS 8.0和8.1以及不 7.1都会出现这种情况。
This occurs for both iOS 8.0 and 8.1 and not 7.1.
为什么会这样?
推荐答案
根据这个,在iOS 8中,似乎视图在实际屏幕外<= strong>之前不会重新响应第一响应者状态。
According to this, in iOS 8 it seems the view doesn’t resign first responder status until it’s actually offscreen.
http://prod.lists.apple.com/archives/cocoa-dev/2014/Sep/msg00391.html
我们的解决方法是在中调用
。 [self.view endEditing:YES]
-viewWillDisappear
Our workaround is to call [self.view endEditing:YES]
in -viewWillDisappear
.
这篇关于iOS 8键盘在解除模态视图控制器后解除延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!