[英]Strange keyboard behavior occurring in iOS11 during transition
In a view controller, I have a view, paddingView
. 在视图控制器中,我有一个视图paddingView
。 I am transitioning to another view, categoryView
, when an event occurs (button is pressed), and this transition is of type UIViewAnimationOptions.transitionFlipFromRight
. 当发生事件(按下按钮)时,我将过渡到另一个视图categoryView
,并且此过渡的类型为UIViewAnimationOptions.transitionFlipFromRight
。 Previously, this worked wonderfully. 以前,这很棒。 However, in the iOS11 (im using 11.1), the keyboard seems to jump when this animation occurs. 但是,在iOS11(使用11.1)中,出现此动画时键盘似乎跳了起来。
//viewDidLoad
titleTextField.becomeFirstResponder()
fileprivate func flipViewToRight() {
//transitionTextField is an off screen textfield, used to keep keyboard up during transition
transitionTextField.becomeFirstResponder()
UIView.transition(from: paddingView, to: self.categoryView!, duration: 0.8, options: UIViewAnimationOptions.transitionFlipFromRight, completion: { (finished: Bool) -> () in
self.categoryView?.searchTextField.becomeFirstResponder()
})
}
And this is the behavior that occurs: https://youtu.be/31xNqBMi-BI 这就是发生的行为: https : //youtu.be/31xNqBMi-BI
Is this a bug with iOS11? 这是iOS11的错误吗? It only seems to occur when this transition is occurring. 它似乎仅在发生这种过渡时发生。
**Also: The keyboard is always open on this view controller, there is always a textfield that is a first responder, before titleTextField
, during transitionTextField
, and after self.categoryView?.searchTextfield
the flip **另外:键盘始终在此视图控制器上打开,始终有一个文本字段作为第一响应者,在titleTextField
之前, transitionTextField
期间,以及self.categoryView?.searchTextfield
翻转之后
I forgot to resign the active textfield before activating another one, this seemed to fix the issue: 我忘记在激活另一个文本字段之前先退出活动文本字段,这似乎可以解决问题:
taskTitleTextView.resignFirstResponder()
transitionTextField.becomeFirstResponder()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.