cocos2d在xcode4.5ios6上屏幕转向的问题

在ios5.1.1真机上测试的非常好,然后上传到appstore,等1周的结果是被拒,苹果审核人员到是仔细,给了我他们的屏幕截图和操作系统环境,在ios6.0.1下屏幕会错位,为了验证该情况,我将iPad有5.1.1系统升级到6.0.1,一看,果然如此,然后在网上找原因,终于找到解决办法:

写道
将AppDelegate.m中的[window addSubview:viewController.view]替换为:

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0){
[window setRootViewController:viewController];
}
else{
[window addSubview:viewController.view];
}

在RootViewController.m中加入以下代码
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotate {
return YES;
}

 估计是ios6,api有稍许改变造成的,不过问题总算是解决了

猜你喜欢

转载自hfutfei.iteye.com/blog/1748469