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

 

 

 

#pragma mark - 实现这个方法来控制屏幕方向
/**
 *  控制当前控制器支持哪些方向
 *  返回值是UIInterfaceOrientationMask*
 */
- (NSUInteger)supportedInterfaceOrientations
{
    /**
     *  UIInterfaceOrientationMaskPortrait : 竖屏(正常)
     *  UIInterfaceOrientationMaskPortraitUpsideDown : 竖屏(上下颠倒)
     *  UIInterfaceOrientationMaskLandscapeLeft : 横屏向左
     *  UIInterfaceOrientationMaskLandscapeRight : 横屏向右
     *  UIInterfaceOrientationMaskLandscape : 横屏(横屏向左\横屏向右)
     *  UIInterfaceOrientationMaskAll : 全部方向(包括上面的所有情况)
     */
    return UIInterfaceOrientationMaskPortrait;
}

 

posted on 2017-03-23 22:15  守望星空  阅读(126)  评论(0编辑  收藏  举报

导航