更新了XCode 4.5之后,全部的项目都是基于iOS6 SDK来开发了。发现一个特别烦恼的问题就是横屏的自动旋转,全部的项目横屏自动旋转都坏掉了。
解决方法我再Google上找到了好多,可是不少不适合个人状况,操做半天也没反映,后来终于发现以下办法:
1.在 RootViewController.m总增长
spa
-(NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskLandscape; } - (BOOL)shouldAutorotate { return YES; }
2.在 AppDelegate.m 中增长
code
window.rootViewController = viewController;
原文地址: http://www.f1982.com/blog/blog