Question

I have an app in which its my intention to change screen orientation as the user rotates the iPad. In my app I have several popovers.

The potential issue I'm concerned about is one of my popovers covers most the screen so if rotation changes, I'd want the popover to change view dimensions. Is it possible whilst a view is open or will i have to close it and reopen it.

Thanks

Was it helpful?

Solution

If your using a UIPopoverController the standard behaviour it does is to hide the popover when you rotate. It try's to then reposition it for you, this tends not to work so you want to use popoverController:willRepositionPopoverToRect:inView to set your new position and resize as needed.

If you use setPopoverContentSize:animated: it will re size for you, If your using autolayout you'll want to use preferredContentSize in the content viewController.

Apple Doc:

If the user rotates the device while a popover is visible, the popover controller hides the popover and then shows it again at the end of the rotation. The popover controller attempts to position the popover appropriately for you but you can also implement the popoverController:willRepositionPopoverToRect:inView: method in the popover delegate to specify a new position.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top