我使用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