我正在构建一个应该处于纵向模式的 cocos2d 游戏。我将 RootViewController.m 更改为纵向模式,并且在模拟器和我的 iPad 上一切正常。但是,当我在 iPhone 上运行该游戏时,它会默认返回横向模式。
关于如何解决这个问题有什么想法吗?
谢谢。
最佳答案
我有一个 100% 有效的更好的解决方案:
替换 RootViewController.m 中的所有内容/ shouldAutorotateToInterfaceOrientation 方法如下:
return ( UIInterfaceOrientationIsPortrait( interfaceOrientation ) );
如果我想在运行时/切换场景时改变方向:
[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
请注意,自动旋转现在不再受支持
关于iphone - Cocos2d 肖像模式在 iPhone 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5987066/