您的位置:首页 > 其它

实现supportedInterfaceOrientations方法来控制当前控制器支持哪些方向

2015-02-04 14:14 555 查看
#pragma mark - 实现这个方法来控制屏幕方向

/**

* 控制当前控制器支持哪些方向

* 返回值是UIInterfaceOrientationMask*

*/

- (NSUInteger)supportedInterfaceOrientations

{

/**

* UIInterfaceOrientationMaskPortrait : 竖屏(正常)

* UIInterfaceOrientationMaskPortraitUpsideDown : 竖屏(上下颠倒)

* UIInterfaceOrientationMaskLandscapeLeft : 横屏向左

* UIInterfaceOrientationMaskLandscapeRight : 横屏向右

* UIInterfaceOrientationMaskLandscape : 横屏(横屏向左\横屏向右)

* UIInterfaceOrientationMaskAll : 全部方向(包括上面的所有情况)

*/

return UIInterfaceOrientationMaskPortrait;

}

注意:当使用导航控制器时需要重写导航控制器的supportedInterfaceOrientations方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: