ios6以上版本的旋转控制
2014-06-19 16:43
260 查看
1.若整个程序没有NavigationController可以直接使用以下这两方法来控制
-(BOOL)shouldAutorotate;
-(NSUInteger)supportedInterfaceOrientations;
2.若整个程序有NavigationController,则应对Nav写个类别,然后再在单个Controller里控制
Nav类别的写法:
方法源参考:http://stackoverflow.com/questions/12803762/ios6-interface-orientation-broken
-(BOOL)shouldAutorotate;
-(NSUInteger)supportedInterfaceOrientations;
2.若整个程序有NavigationController,则应对Nav写个类别,然后再在单个Controller里控制
Nav类别的写法:
@implementation UINavigationController (Rotation_IOS6) -(BOOL)shouldAutorotate { return [self.topViewController shouldAutorotate]; } -(NSUInteger)supportedInterfaceOrientations { return [self.topViewController supportedInterfaceOrientations]; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return [self.topViewController preferredInterfaceOrientationForPresentation]; } @end
方法源参考:http://stackoverflow.com/questions/12803762/ios6-interface-orientation-broken
相关文章推荐
- 【精】iOS6 及其以上版本自动旋转、手动强制旋转方案及布局适配
- iis7以上版本权限控制
- iOS6以上屏幕旋转详解
- iOS6的控制屏幕旋转技巧
- iOS 6.0以上版本的旋屏控制处理
- iOS6下关于屏幕旋转的控制
- 【精】iOS6 及其以上版本号自己主动旋转、手动强制旋转方案及布局适配
- apache 2.4 以上版本其他主机访问控制
- iis7以上版本权限控制
- Vista及以上版本的音量控制(Delphi版)
- 如何在android3.2以上版本中控制横竖屏切换
- iOS6的控制屏幕旋转技巧
- iOS6的控制屏幕旋转技巧
- iOS6的旋屏控制 不同以前版本
- Android 不同版本7.0以下,7.0,7.1以上 popwindow展示位置控制分享
- iOS 6及以上控制个别视图旋转案例
- Android 4.0.3以上版本 免root 开启Adb Wifi调试
- CVS:版本控制的开放标准
- Tortoise SVN 版本控制常用操作知识
- Struts2.5版本以上的struts.xml配置