我们有一个 ipad 应用程序,它支持横向左右方向。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Overriden to allow any orientation.
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
我们通过调用将视图控制器显示为模态视图
childController.modalPresentationStyle = UIModalPresentationPageSheet;
childController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[parentController presentViewController:childController animated:childController.animated completion:^{
childController->isBeingShowed = FALSE;
当我们显示一个模式视图时: RootViewController(FullScreen)->SelectOption(500, 500) 旋转工作正常并且选择选项视图控制器具有它的原始大小。
当我们显示附加模式视图时:RootViewController(FullScreen)->SelectOption(500, 500)->Additional options(300, 300),旋转后 SelectOption 视图控制器大小更改为全屏,而 AdditionalOptions 视图控制器保持指定的大小.