我們有一個ipad應用程序,支持landsace的左右方向。ios 6旋轉後的模態視圖大小不正確
- (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的(全屏) - > SelectOption(500,500)的旋轉工作正常,並選擇相應的選項視圖控制器具有原始大小。
當我們顯示額外的模式視圖:RootViewController(FullScreen) - > SelectOption(500,500) - >其他選項(300,300),旋轉後SelectOption視圖控制器大小改變爲全屏,而AdditionalOptions視圖控制器保持它的尺寸如指定。
你可以找到在http://stackoverflow.com/questions/12554204/ios-6-rotation-issue-no-rotation-from-presented-modal-view-controller – freytag
的答案,我問在這裏回答同樣的問題:http://stackoverflow.com/a/14989999/1742521希望它有幫助。 –
感謝您的鏈接,但這不是同一個問題。模態視圖的方向會根據情況進行更改,但如果模態視圖的父級具有相同的演示樣式,則會變爲全屏 –