视网膜显示与非视网膜显示的景观

时间:2012-04-22 20:35:45

标签: iphone objective-c

我有一个Landscape ViewConroller,

我创建并添加:

gameVC = [[GameViewController alloc] initWithNibName:@"GameViewController" 
                                                                  bundle:nil];
[viewController.view removeFromSuperview];
[self.window addSubview:gameVC.view];

GameViewController我有方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){
        return YES;
    }else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
        return YES;
    }else {
        return NO;
    }
}

现在的问题是,当我在iphone 3(或其他非视网膜屏幕)上运行应用程序时,屏幕看起来像xib文件,当我在iphone 4(或其他视网膜屏幕)上运行时,UIViews就在UIViewController在左边10-20个像素。

任何想法如何修复它?

1 个答案:

答案 0 :(得分:0)

在GameViewController.xib的Interface Builder的Size Inspector中检查自动调整遮罩的视图。此外,父视图(有问题的视图)的精确大小可能是错误的大小(关闭几个像素)。