ios 6 Incorrect modal view size after rotation

五迷三道 提交于 2019-12-23 17:13:51

问题


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.


回答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.



来源:https://stackoverflow.com/questions/12599621/ios-6-incorrect-modal-view-size-after-rotation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!