在需要禁止旋转的页面的父类里面复制如下三个方法。
- (BOOL)shouldAutorotate {
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
// return [self.viewControllers.lastObject supportedInterfaceOrientations];
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
// return [self.viewControllers.lastObject preferredInterfaceOrientationForPresentation];
return UIInterfaceOrientationLandscapeLeft;
}