我的应用程序以横向模式正确启动并且运行良好:
- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationPortrait)
return NO;
if(interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft )
return YES;
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
并更新了 Info.plist
UIInterfaceOrientation = UIInterfaceOrientationLandscapeRight
现在在我的主控制器中,我将一个 ViewController 换成另一个
characterController = [ [ CharacterController alloc ] init];
myCurrentViewController = characterController;
self.view = myCurrentViewController.view ;
它加载但方向处于纵向模式。如果我随后旋转 iPhone,它会将其更正为横向模式。在将新的 viewController 加载到我的 mainController 时如何保持横向的任何想法?