iOS6 横屏项目自动旋转的问题解决 cocos2d

更新了XCode 4.5以后,所有的项目都是基于iOS6 SDK来开发了。发现一个特别烦恼的问题就是横屏的自动旋转,所有的项目横屏自动旋转都坏掉了。

解决方法我再Google上找到了好多,但是很多不适合我的情况,操作半天也没反映,后来终于发现如下办法:

1.在 RootViewController.m总增加

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskLandscape;
}


- (BOOL)shouldAutorotate {
    return YES;
}


2.在 AppDelegate.m 中增加

window.rootViewController = viewController;


原文地址:http://www.f1982.com/blog/

posted @ 2012-10-31 10:32  乐逍遥Jun  阅读(215)  评论(0编辑  收藏  举报