页面大部分是竖屏,个别页面可以旋转手机时页面变为横屏实现步骤:
1.使应用可以横屏,新创建的默认就可以
2.在需要横屏的视图控制器里面实现以下方法
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeLeft;
}
-(BOOL)shouldAutorotate
{
return NO;
}