美文网首页iOS Developer
iOS项目锁住横屏时,设置指定控制器横屏

iOS项目锁住横屏时,设置指定控制器横屏

作者: Captain_XR | 来源:发表于2016-08-30 16:34 被阅读0次

//  直接把代码写在控制器内部即可,方法都是系统自动调用的

#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;

}

相关文章

网友评论

    本文标题:iOS项目锁住横屏时,设置指定控制器横屏

    本文链接:https://www.haomeiwen.com/subject/cmlfettx.html