私は現在、iOS 5 および iOS 6 で動作するアプリケーションを開発しています。私のビューのほとんどは、1 つを除いて縦向きのみです。
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 に戻りますが、PageViewController は縦向きのみをサポートします。
もちろん、ImageViewController のマスクviewWillDisappear
を Portrait にリセットします。
PageViewController を縦向きのままにする方法はありますか?