【发布时间】:2013-05-04 03:23:19
【问题描述】:
我正在将 Everyplay 与我的 Cocos2d 游戏集成。我的游戏仅支持横向方向。 在 iPad 上一切顺利。 但是当我在 iPhone(iOS6) 上测试时,当我调用“[[Everyplay sharedInstance] showEveryplay]”时会抛出如下异常: 原因:'支持的方向与应用程序没有共同的方向,并且 shouldAutorotate 正在返回 YES'
我知道iOS6中的方向机制发生了变化。所以我添加了这个方法:
-(BOOL)shouldAutorotate{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
-(NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
然后“[[Everyplay sharedInstance] showEveryplay]”毫无例外地工作,但我的游戏也支持我不想的纵向。
如果我只想在My Game中支持Landscape,却让“[[Everyplay sharedInstance] showEveryplay]”无异常工作,该怎么办?
【问题讨论】: