当键盘显示+ iPad时,UIPopoverView会变形 [英] UIPopoverView becoming distorted when keyboard is shown + iPad
问题描述
我遇到了UIPopoverViewController布局的问题。目前我正在展示尺寸为PopOver(350,820)。我有一个单击UIAlertView的按钮,其中会显示一个文本字段。同时还会显示键盘。现在的问题是,每当键盘被我的PopOver变得扭曲。意味着popover的向上箭头向右移动,popover的内容与其他内容混合。
I am having an issue with the layout of UIPopoverViewController. Currently I am showing an PopOver of Size (350, 820). I have a button clicking on UIAlertView will be shown with a text field within it.At the same time keyboard is also shown. Now the problem is that whenever the keyboard is my PopOver becomes distorted. Means the up arrow of popover shifts to right and contents of popover mix witheach other.
这方面的任何帮助都将非常感谢。
Any help in this regard will greatly appreciated.
Thanx
推荐答案
我遇到了同样的问题。虽然它并不理想,但我的解决方法是使弹片更小,以便它可以容纳键盘而不需要调整大小。
I was seeing the same problem. Although it is not ideal, my work-around was to make the popover smaller so it could accommodate the keyboard without resizing itself.
//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)];
如果你的popover内容对于这种方法来说太大了,你可以将它放在UIScrollView中在一个较小的popover内。
If your popover content is too big for this approach, you might be able to place it in a UIScrollView within a smaller popover.
另见这个解决方案:
当UISearchBar聚焦时,SplitViewController的弹出窗口UI错误
这篇关于当键盘显示+ iPad时,UIPopoverView会变形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!