UIPopoverView becoming distorted when keyboard is

2019-04-29 14:45发布

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

2条回答
混吃等死
2楼-- · 2019-04-29 15:08

I also the same problem. My popover's arrow was then pointing up and i changed the arrow direction facing down. It solved the problem.

查看更多
老娘就宠你
3楼-- · 2019-04-29 15:19

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)];

If your popover content is too big for this approach, you might be able to place it in a UIScrollView within a smaller popover.

Also see this solution: SplitViewController's popover UI error when UISearchBar is in focus

查看更多
登录 后发表回答