我想阻止某些UIViewController
的风景方向。我读了很多不同的东西来管理它,但我没有找到一个解决方案运行良好。每次,方向都不会被阻塞,即使它应该是。即使我挡住风景旋转,屏幕仍在旋转
我有以下代码以阻止在UIViewController
横向方向不具有的横向旋转:
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
即使是,该视图以横向旋转。
我错过了什么吗?
您需要使用自定义导航控制器来阻止方向。 – 2014-12-04 10:16:02