我正在开发box2d游戏。我的游戏uiinterfaceOrientation是UIInterfaceOrientationLandscapeLeft,它在ios5.1下运行良好,但是ios6.0我遇到了界面定向问题。我知道- shouldAutorotateToInterfaceOrientation:在iOS 6.0中不推荐使用。对于interfaceOrientation,它们给出了类似的接口方向设置,toUIInterfaceOrientationMaskAll用于iPad习惯用法,UIInterfaceOrientationMaskAllButUpsideDown用于iPhone习惯用法。我不知道如何使用这个(UIInterfaceOrientationMaskAll)。我需要在UIInterfaceOrientationLandscapeLeft里玩游戏。你能告诉我如何解决这个问题吗?谢谢..
发布于 2012-09-14 22:54:32
Here is a link to a blog about the new functions.
对于您的需求,您需要添加的全部内容是:
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscapeLeft;}这将使它只允许您运行景观左。
发布于 2012-09-17 17:45:20
此外,还应该在UISupportedInterfaceOrientations中添加UIInterfaceOrientationLandscapeLeft,并在Info.plist中添加UIInterfaceOrientation属性。您还可以通过从shouldAutorotate回调中明确返回false来阻止进一步的自动旋转。
https://stackoverflow.com/questions/12419347
复制相似问题