我有一个MainViewController,它有一个按钮,通过翻转horizontailly推动一个新的视图(InfoViewController).像这样:
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
Run Code Online (Sandbox Code Playgroud)
MainView控制器支持Portrait和PortraitUpsideDown.像这样:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskPortraitUpsideDown);
}
Run Code Online (Sandbox Code Playgroud)
在我的InfoViewController中,它还说明了上面的代码.在我的AppDelegate中,它在LaunchOptions中有这个:
[self.window setRootViewController:self.mainViewController];
Run Code Online (Sandbox Code Playgroud)
在我的app.plist文件中,它支持所有方向.这是因为其他观点也需要支持景观.所以在我的MainViewController和InfoViewController上我只需要Portrait和PortraitUpsideDown.但另一种观点我需要所有的观点.
我的MainViewController工作正常,但我的InfoViewController适用于所有方向.
我正在努力让这个在iOS6中运行起来.我已经研究了其他帖子,并尝试过其他人提供的帮助,但没有任何运气.请有人帮助我实现这一点谢谢.我是Objective-C的新手:p