Ios 6 Incorrect modal view size after rotation

We have an ipad application that supports left and right landscape orientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Overriden to allow any orientation. return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } 

We show view controllers as a modal view, invoking

 childController.modalPresentationStyle = UIModalPresentationPageSheet; childController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [parentController presentViewController:childController animated:childController.animated completion:^{ childController->isBeingShowed = FALSE; 

When we show one modal view: RootViewController (FullScreen) → SelectOption (500, 500) rotation works fine and selects parameters, the controller has the original size.

When we show an additional modal view: RootViewController (FullScreen) → SelectOption (500, 500) → Additional parameters (300, 300), after rotating SelectOption, the size of the view controller is changed to full screen, while the ViewOpions controller saves its size as indicated.

+3
source share
1 answer

The problem was solved with a little trick.

The root of them is the problem that I open the first modal view as PageSheet, when I open the second modal view from the first, I have MainView (FullScreen), the modal view is open as a page sheet, and the second page sheet is open from the previous page sheet. This architecture caused rotation problems.

Trick: now I open the second modal view in the form of FormSheet with recalculation of coordinates to match the PageSheet coordinate system. So now it looks like MainView-> PageSheet-> FormSheet and the problem has been fixed.

Sorry to be without a code.

+1
source

All Articles