简体   繁体   English

解除弹出框后的第一响应者/焦点

[英]First responder/focus after dismissing popover

I have a few UITextField inputs on a form screen where some of them have a numpad display that is shown via a custom popover.我在表单屏幕上有一些 UITextField 输入,其中一些有一个通过自定义弹出框显示的小键盘显示。 As the user advances through the fields, we close or open the popover as appropriate.当用户在字段中前进时,我们会根据需要关闭或打开弹出窗口。 In iOS 11, it seems the "first responder" or field focus is returned to the previous input.在 iOS 11 中,似乎“第一响应者”或字段焦点返回到先前的输入。 As a result, we end up trying to dismiss the main view accidentally.结果,我们最终试图意外地关闭主视图。

Is this a known change in iOS 11 or is it a bug?这是 iOS 11 中的已知更改还是错误? Is there a way to prevent the first responder from going back, and instead advancing forward or not changing at all - some type of tab index, maybe?有没有办法阻止第一响应者返回,而是向前推进或根本不改变 - 某种类型的标签索引,也许?

This other SO question presents the same issue, but has not been resolved yet either. This other SO question提出了同样的问题,但也尚未解决。 I can't comment on that issue to increase its visibility, hence this new question.我无法对这个问题发表评论以提高其知名度,因此是这个新问题。

关闭textFieldShouldEndEditing (并返回 true)而不是textFieldDidEndEditing的弹出框对我textFieldDidEndEditing

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

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