首页 > 移动平台 > 详细

ios6和ios7禁止屏幕旋转

时间:2014-07-14 15:45:00      阅读:381      评论:0      收藏:0      [点我收藏+]

 

ios6和ios7禁止屏幕旋转

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);

}

- (BOOL)shouldAutorotate

{

    return NO;

}

- (NSUInteger)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskPortrait;//只支持这一个方向(正常的方向)

}这些方法不行 

再。。。。。

在appdelegate中添加如下代码

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

        return UIInterfaceOrientationMaskAll;

    else  /* iphone */

        return UIInterfaceOrientationMaskPortrait ;

}

 

ios6和ios7禁止屏幕旋转,布布扣,bubuko.com

ios6和ios7禁止屏幕旋转

原文:http://www.cnblogs.com/zhujin/p/3842607.html

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