【发布时间】:2013-11-26 15:15:25
【问题描述】:
我有一个只能在横向模式下运行的游戏。当我展示相机时,应用程序由于方向问题而崩溃。我通过在 AppDelegate 中添加以下方法解决了这个问题。
-(NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
-(BOOL)shouldAutorotate {
return [[UIDevice currentDevice] orientation] != UIInterfaceOrientationPortrait;
}
但是它可以工作,但它会更改应用程序以支持所有方向。我需要的是该应用程序仅支持相机的肖像模式。展示相机后,应用程序仅支持横向模式。
任何帮助将不胜感激。
【问题讨论】:
标签: ios iphone cocos2d-iphone