Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIPopoverController moves strangely on iOS 7 when keyboard appears

I have a UIPopoverController with a text field in it. On iOS 6, when the user taps the text field and the popover happens to be in the way of the keyboard sliding onscreen, the popover moves nicely out of the way.

On iOS 7, it flies to the edge of the screen. It's ridiculous.

Is this just a bug in iOS 7? Is there a way to control this behavior in iOS 7 that didn't exist before?

Thanks.

like image 240
Greg Maletic Avatar asked Oct 02 '13 22:10

Greg Maletic


2 Answers

Try to change permittedArrowDirections from UIPopoverArrowDirectionAny to UIPopoverArrowDirectionLeft | UIPopoverArrowDirectionRight in -

(void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated;

like image 120
pingwinator Avatar answered Dec 09 '22 10:12

pingwinator


Seems there is a problem with the arrow direction for popovers. This forum post is related and seems to have more info https://devforums.apple.com/message/873738#873738

https://devforums.apple.com/message/885612#885612

like image 28
roshi Avatar answered Dec 09 '22 09:12

roshi