我有一个MainViewController,它有一个按钮,通过水平翻转的方式推出一个新视图(InfoViewController),如下所示:
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
主视图控制器支持纵向和倒立的纵向。如下所示:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskPortraitUpsideDown);
}
在我的InfoViewController中,也标明了上述代码。在我的AppDelegate中,LaunchOptions有这个:
[self.window setRootViewController:self.mainViewController];
我的app.plist文件支持所有方向,因为其他视图也需要支持横屏方向。所以在我的MainViewController和InfoViewController中,我只需要竖屏和倒立竖屏。但是在另一个视图中,我需要所有方向。
我的MainViewController工作正常,但是我的InfoViewController适用于所有方向。
我尝试在iOS6中实现这个功能非常困难。我已经研究了其他帖子,并尝试了其他人提供的方法,但完全没有成功。请有人帮助我实现这个,谢谢。我是Objective-C新手:p