我目前正在开发与iOS 5的和iOS 6 工作我的大部分意见只在除1iOS 6的定位与NavigationController
RotationNavigationController肖像方向的应用程序:主要UINavigationController
重写supportedInterfaceOrientation
和shouldAutorotate
。
PageViewController:推入RotationNavigationController并仅以纵向方向显示。
ImageViewController:推送PageViewController后。与UIInterfaceOrientationMaskAllButUpsideDown
一起显示。
下面是我在ImageViewController
的ViewDidLoad
- (void)viewDidLoad
{
// currentMask is the value returned by supportedInterfaceOrientation
[(RotationNavigationController*)self.navigationController setCurrentMask:UIInterfaceOrientationMaskAllButUpsideDown];
[(RotationNavigationController*)self.navigationController setShouldAutorotate:YES];
}
当我在景观popViewController
从ImageViewController,我回到PageViewController在横向模式过于而PageViewController只支持纵向。
当然,我将ImageViewController的viewWillDisappear
中的遮罩重置为肖像。
有没有办法让PageViewController保持纵向?
这在http讨论了(似乎平凡):// stackoverflow.com/questions/12640870/ios-6-force-device-orientation-to-landscape – emrys57