一、presentViewController一个横屏视图
1.首先设置项目 支持的屏幕方向
2.在自己的根导航栏控制器(BaseNavigationController)中重写方法:shouldAutorotate 和 supportedInterfaceOrientations
//支持旋转
-(BOOL)shouldAutorotate{
return [self.topViewController shouldAutorotate];
}
//支持的方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return [self.topViewController supportedInterfaceOrientations];
}
3、界面A跳转至B界面,如下是A界面的设置
//支持旋转
-(BOOL)shouldAutorotate{
return YES;
}
//支持的方向 因为界面A我们只需要支持竖屏
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
4、B界面的设置
//支持旋转