我有一个风景 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(或其他视网膜屏幕)上运行它时,UIViewController 上的 UIViews 在左侧 10-20 个像素。
知道如何解决吗?