ios中单个页面强制横屏!

作者: 小专注 | 来源:发表于2017-08-07 14:16 被阅读85次

代码如下(实现右横屏),注意这个页面必须用present的方式推出.

(而且是必须present这个VC, 不能present被导航控制器管理的VC)

-(BOOL)shouldAutorotate

{

return NO;

}

-(UIInterfaceOrientationMask)supportedInterfaceOrientations

{

return UIInterfaceOrientationMaskLandscape;

}

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation

{

return UIInterfaceOrientationLandscapeRight;

}

(根视图到A,A present B)代码添加在B中!

相关文章

网友评论

    本文标题:ios中单个页面强制横屏!

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