2012-04-22 81 views
0

我有一個景觀ViewConroller,景觀Retina顯示屏與非Retina顯示屏

我創建並添加:

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個像素。

任何想法如何解決它?

回答

0

檢查GameViewController.xib的Interface Builder中Size Inspector中視圖的自動調整掩碼。此外,父視圖(有問題的視圖)的精確大小可能是錯誤的大小(由幾個像素關閉)。