3

在我的 cocos2d 应用程序中,在我的应用程序委托的 applicationDidFinishLaunching 方法中,我通过 [director setDeviceOrientation:kCCDeviceOrientationPortrait] 设置方向,因为我真的只想要纵向。但是,Apple 拒绝了我的应用程序,说它也必须支持倒置肖像。

不过,我不确定我是如何检测到这一点的。读取 currentDevice 方向似乎返回了一个未知的方向,所以我的问题是双重的:

1)我应该如何检测方向,以便我可以正确地将其设置为纵向或倒置纵向(它将永远保持不变)。

2) 我怀疑启动画面会出现问题,因为它是在我到达代理中的这一点之前加载的。如何正确检测方向以便设置正确的启动画面?

4

1 回答 1

5

我只能编辑代码来解决您的第一个问题.. 我希望您使用的是 .99.5..

在 RootViewController.h 中,在函数中

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

寻找这一行:

#elif GAME_AUTOROTATION == kGameAutorotationUIViewController
{
return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
}

改成

    return ( UIInterfaceOrientationIsPortrait( interfaceOrientation ) );
于 2011-02-07T04:49:25.403 回答