键盘消失后 UIPopoverController 的视图控制器会调整大小
我在 UIPopoverController
内有一个视图控制器。当我打开属于弹出窗口中视图的文本字段的键盘时,视图会调整大小以适应键盘。但是,当键盘关闭时,视图不会恢复到原始大小。
有什么想法如何让它调整回原来的大小吗?
I have a view controller inside a UIPopoverController
. When I open a keyboard for a text field that belongs to the view in the popover, the view resizes to accommodate the keyboard. However, the view doesn't go back to the original size when the keyboard is dismissed.
Any ideas how to get it to resize back to what it was?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己最近也遇到这个问题。
我解决这个问题的方法是观察键盘在控制 UIPopoverController 的控制器中消失:
然后在
-presentSearchPopover
中,再次呈现 UIPopoverController (这是一个相当无缝的过渡):不要忘记删除
-dealloc
或类似的观察者:Had this problem myself recently.
The way I got around it was to observe the keyboard disappearing in the controller which controls the UIPopoverController:
And then in
-presentSearchPopover
, present the UIPopoverController again (it's quite a seamless transition):Don't forget to remove the observer in
-dealloc
or similar too: