3

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

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

We are showing view controllers as modal view by calling

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

When we are showing one modal view: RootViewController(FullScreen)->SelectOption(500, 500) rotation works fine and select options view controller has it's original size.

When we are showing additional modal view: RootViewController(FullScreen)->SelectOption(500, 500)->Additional options(300, 300), after rotation SelectOption view controller size changed to full screen while AdditionalOptions view controller keeps it's size as was specified.

  • You can find the answer at http://stackoverflow.com/questions/12554204/ios-6-rotation-issue-no-rotation-from-presented-modal-view-controller – freytag Jan 16 '13 at 20:56
  • I asked and answered same question here: http://stackoverflow.com/a/14989999/1742521 Hope it helps. – Code freeeeeeeze Feb 20 '13 at 21:18
  • Thanks for the link, but this is not same problem. Orientation of modal view changes as it should, but if parent of modal view has same presentation style it becomes fullscreen – Vitaliy Gervazuk Feb 27 '13 at 08:52

1 Answers1

1

The problem was solved with small trick.

The root of them problem, was that i'm opening first modal view as PageSheet, when i'm opening second modal view from first one i got MainView(FullScreen), modal view opened as page sheet, and second page sheet opened from previous page sheet. This architecture caused problems with rotation.

Trick: now i'm opening second modal view as FormSheet with recalculating coordinates to correspond PageSheet coordinate system. So now it looks like this MainView->PageSheet->FormSheet and the problem was fixed.

Sorry that without the code.