swift3 设置设备方向支持(supportedInterfaceOrientations)
2017-05-22 20:10
483 查看
1、改变整个app的设备方向支持
2、代码改变app不同场景的设备旋转方向支持(可以在不同的viewController中处理对设备方向的不同需求)
ps.supportedInterfaceOrientations只能在根控制器中生效,即在navigationController或者tabbarController中生效
设置之后当前的控制器和子控制器都会遵守这个方向
ps.supportedInterfaceOrientations 是能在(tabbarController或者navigationController)中生效
2、代码改变app不同场景的设备旋转方向支持(可以在不同的viewController中处理对设备方向的不同需求)
ps.supportedInterfaceOrientations只能在根控制器中生效,即在navigationController或者tabbarController中生效
override var supportedInterfaceOrientations: UIInterfaceOrientationMask{ return .portrait }
设置之后当前的控制器和子控制器都会遵守这个方向
ps.supportedInterfaceOrientations 是能在(tabbarController或者navigationController)中生效
相关文章推荐
- 实现supportedInterfaceOrientations方法来控制当前控制器支持哪些方向
- Swift3.0 -- 设置设备方向支持
- 8.29 设置设备支持方向
- ios-UIViewController和魔态视图的应用以及设备支持方向的设置
- - (NSUInteger)supportedInterfaceOrientations 屏幕旋转方向选择
- swift 中的 supportedInterfaceOrientationsForWindow
- Swift: 消除警告- All interface orientations must be supported unless the app requires full screen
- Error: No such interface supported 不支持此接口
- Swift - 使用CoreLocation获取设备方向(真实方向,磁极方向)(转帖)
- ios9 - (NSUInteger)supportedInterfaceOrientations 警告
- swift开发笔记5 - 设置屏幕方向和代码控制布局
- Swift - 项目部署配置(支持的系统,设备和状态条样式等)
- Swift - 使用CoreLocation获取设备方向(真实方向,磁极方向)
- 设置Win7无线网络共享 让其它支持wifi设备上网
- cocos2d 2.x 设备方向设置问题
- 【cocos2D-iphone 2.x设备方向设置】
- UIView设置为自动适配屏幕时,当用户旋转设备的时候,会调用layoutSubviews方法,我们只需重写 这个方法,然后判断用户屏幕的方向。在调整每个空间的位置即可。
- 设置设备支持指定的屏幕
- iOS开发——设置支持的iOS设备(512m内存以上设备)