我使用cocos2d引擎,但没有自动旋转,只使用横向方向。在风景中显示游戏中心模式视图
我想显示标准的GC成就模态视图。 通常从屏幕底部(将设备保持在横向)显示,但屏幕右侧(如纵向模式视图)不显示。这似乎正在改变解雇动画的方向,但在此之前,观点并不旋转。它只是向右滑动。
而且我在控制台收到了警告:
Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x41b9a0>.
这就是我如何显示此控制器:
-(void)showAchievements:(id) sender {
utilityController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
[[[CCDirector sharedDirector] openGLView] addSubview:utilityController.view];
GKAchievementViewController *achievements = [[GKAchievementViewController alloc] init];
if (achievements != nil)
{
achievements.achievementDelegate = self;
[utilityController presentModalViewController: achievements animated: YES];
}
[achievements release];
}
- (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
{
[utilityController dismissModalViewControllerAnimated:YES];
[utilityController release];
}
在gameConfig.h我有以下配置:
#define GAME_AUTOROTATION kGameAutorotationNone
尝试将其更改为kGameAutorotationCCDirector
- 同样的事情。 kGameAutorotationUIViewController
- uiviews在整个屏幕上跳跃。
请不要建议与CGAffineTransformMakeRotation
旋转的UIView - 它只是一个黑客...
谢谢你的答案,但这个方向的修复不适合GKAchievementViewController工作为了我。这个视图在发射和解散之后仍然从底部向上滑动 - 进入屏幕的右侧。 – 2012-02-06 12:29:00
提醒一下,此代码适用于GKMatchmakerViewController。你确定你修改它为GKAchievementViewController吗? – erkanyildiz 2012-02-20 23:08:21
是的,当然..现在让它以这种方式工作。稍后将进行调查。 – 2012-03-12 18:56:34