引言:
iPhone的横屏竖屏针对iOS系统版本分为两种开发方式: 一种是iOS 6之前的使用模式 一种是iOS6的新模式. 两者的区别还是蛮大的.
参考:
1:IOS6屏幕旋转详解(自动旋转、手动旋转、兼容IOS6之前系统)
http://blog.csdn.net/cococoolwhj/article/details/8208991
使用:
支持自动旋转?
iOS6之前通常使用 shouldAutorotateToInterfaceOrientation 来单独控制某个UIViewController的方向,需要哪个viewController支持旋转,只需要重写shouldAutorotateToInterfaceOrientation方法。如下示例,设置以后,屏幕被旋转时只支持横屏转换:
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- {
- return UIInterfaceOrientationIsLandscape(interfaceOrientation);
- }
iOS6之后使用如下两个方法控制自动旋转,分别是:
copy