首页 > 其他 > 详细

强制设置页面横竖屏的问题

时间:2015-11-30 17:43:09      阅读:269      评论:0      收藏:0      [点我收藏+]

有的时候有的需求会让页面强制的横竖屏转换,再之后的ios的版本中,- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation被官方废弃了,不能继续使用的,下面是ios6之后的强制横竖屏的方法:

-(BOOL)shouldAutorotate

{

    return YES;

}

 

-(UIInterfaceOrientationMask)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskLandscape;

}

 

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation

{

    return UIInterfaceOrientationLandscapeRight;

}

 

-(BOOL)prefersStatusBarHidden

{

    return NO;

}

 还有一点需要说明的是,跳转到下一个页面强制横竖屏的时候只能使用presentViewController,而不能使用push跳转的方法,切记!!!

强制设置页面横竖屏的问题

原文:http://www.cnblogs.com/Acee/p/5007736.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!