您的位置:首页 > 产品设计 > UI/UE

16-UIViewController 手动控制旋转

2015-07-09 20:44 701 查看
 1.将4个勾勾上 默认控制器view都能4方向旋转 如需做特定旋转方向  执行第二步



//禁止旋转

- (BOOL)shouldAutorotate

{

    return
NO;

}

- (NSUInteger)supportedInterfaceOrientations

{

    /*以home键为准上下左右

     UIInterfaceOrientationMaskPortrait
正常状态 home键在下

     UIInterfaceOrientationMaskPortraitUpsideDown
从下旋转 home键在上

     UIInterfaceOrientationMaskLandscapeLeft   home键在左面

     UIInterfaceOrientationMaskLandscapeRight  home键在右面

    

     UIInterfaceOrientationMaskLandscape
支持左和右旋转

     UIInterfaceOrientationMaskAllButUpsideDown
支持正常和左右旋转

     UIInterfaceOrientationMaskAll
支持4个方向旋转

     */
   
return UIInterfaceOrientationMaskLandscapeRight;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  IOS开发 UI基础 控件