我遇到了 UIPopoverViewController 的布局问题。目前我正在展示一个大小为 (350, 820) 的 PopOver。我有一个按钮,单击 UIAlertView 将显示其中的文本字段。同时还显示键盘。现在的问题是,只要键盘是我的 PopOver 就会扭曲。表示popover的向上箭头向右移动,popover的内容相互混合。
在这方面的任何帮助将不胜感激。
谢谢
最佳答案
我看到了同样的问题。虽然它并不理想,但我的解决方法是使弹出框更小,以便它可以容纳键盘而无需调整自身大小。
//Work around a bug that causes the popover frame and table cells to become
//corrupted when the keyboard is displayed and the popover resizes.
[self setContentSizeForViewInPopover:CGSizeMake(320, 588)];
如果您的弹出框内容对于这种方法来说太大,您可以将它放在一个较小的弹出框内的 UIScrollView 中。
另请参阅此解决方案:
SplitViewController's popover UI error when UISearchBar is in focus
关于ipad - 显示键盘 + iPad 时 UIPopoverView 变得扭曲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3994919/