在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;
}
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有稍许改变造成的,不过问题总算是解决了

本文介绍了一款应用在iOS6.0.1版本中出现屏幕错位的问题及解决办法。作者通过调整AppDelegate.m文件中的窗口设置代码,并在RootViewController.m中加入了方向支持代码,成功解决了这一问题。
186

被折叠的 条评论
为什么被折叠?



