iOS项目锁住横屏时,设置指定控制器横屏
2016-08-30 本文已影响0人
Captain_XR
// 直接把代码写在控制器内部即可,方法都是系统自动调用的
#if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_9_0
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
// return UIInterfaceOrientationLandscapeLeft;
return UIInterfaceOrientationLandscapeRight;
}
-(BOOL)shouldAutorotate
{
return NO;
}