我开发了使用游戏中心的IOS 5应用程序。现在我想让我的代码在IOS 6上运行。因此,我让应用程序支持横向和纵向两种方向,以便在弹出游戏中心登录屏幕时不会崩溃。但之后,我的主视图控制器不能以横向视图开始。相反,当我进一步观察时,它会以横向打开,然后当我回来时,主视图会在横向打开。但首页并未打开到横向模式。在xcode 4.5中设置横向模式的方向GM IOS 6
下面是代码:
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
这些都是我在家里视图使用IOS 6
你是否支持项目plist文件中的所有方向? – AppleDelegate
@AppleDelegate - 仅支持两种风景方向。 – NiKKi
您的homeViewController是UINavigationController的根视图控制器吗? – rocky