如何在 iPad 上的横向模式中关闭包含 UITextView 的模态视图控制器表单?
我有一个模态视图控制器,在 iPad 上以横向形式呈现为表单。当我关闭视图时,视图会跳转到不同的位置,如以下线程所示:
横向键盘的模态 VC 在关闭时会更改位置: 横向 iPad 上带有键盘的模态视图控制器关闭时更改位置
对该线程的响应是调用 resignFirstResponder,但是,在使用表单或页面表时不允许关闭键盘:
还有其他人遇到过这个问题吗?有没有办法在动画消失时强制关闭键盘或强制视图进入一个合适的位置?
干杯, 缺口。
I have a Modal View Controller presented as a Form Sheet in Landscape on an iPad. When I dismiss the view, the view jumps to a different location, as in this thread:
A modal VC with a keyboard on landscape changes location when dismissed:
Modal View Controller with keyboard on landscape iPad changes location when dismissed
The response to that thread is to call resignFirstResponder, however, you are not allowed to dismiss keyboards when using a Form or Page Sheet:
Modal Dialog Does Not Dismiss Keyboard
Has any one else had this problem? Is there a way to either force the keyboard to be dismissed or force the view into a nice position when it's being animated away?
Cheers,
Nick.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅当模式表单关闭后,键盘才会被删除。苹果的想法是,如果您使用模态表单,那么您将需要键盘来输入多个字段,因此不应将其删除。
The keyboard will be removed only after the modal form is dismissed. Apple has the idea that if you are using modal form, then you'll need the keyboard for multiple fields therefore it shouldn't be removed.