【发布时间】:2012-11-28 11:40:38
【问题描述】:
我目前正在开发一个适用于 iOS 5 和 iOS 6 的应用程序。 我的大部分观点都只针对纵向,除了 1。
RotationNavigationController:覆盖supportedInterfaceOrientation 和shouldAutorotate 的主UINavigationController。
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];
}
当我在横向模式下从 ImageViewController popViewController 时,我也会以横向模式返回 PageViewController,而 PageViewController 仅支持纵向。
当然,我将 ImageViewController 的 viewWillDisappear 中的蒙版重置为 Portrait。
有没有办法让 PageViewController 保持纵向?
【问题讨论】:
-
这已经在stackoverflow.com/questions/12640870/…进行了讨论(并且看起来很重要)
标签: ios uinavigationcontroller ios6 orientation