iPad游戏中心

时间:2011-04-17 16:09:28

标签: ipad game-center

GKLeaderboardViewController *leaderboardController = [[[GKLeaderboardViewController alloc] init] autorelease];
if (leaderboardController != nil) {
  // start the leader board view controller
  leaderboardController.leaderboardDelegate = self;
  leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;
  leaderboardController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
  leaderboardController.modalPresentationStyle = UIModalPresentationFullScreen;
  leaderboardController.category = @"map1";
  RootViewController* rootVC = ((AppDelegate*)[UIApplication   sharedApplication].delegate).viewController;
  [rootVC presentModalViewController:leaderboardController animated:YES];
}

我有一个iPhone应用程序,它可以与gamecenter一起使用。 但是当我构建iPad版本时,游戏中心排行榜仍然显示iPhone尺寸(320x480)。

所以我添加了这个:leaderboardController.modalPresentationStyle = UIModalPresentationFullScreen; 但是显示屏已损坏,标签栏上的3个按钮(今天,本周,所有时间)都不是全屏。 和木框架。

1 个答案:

答案 0 :(得分:0)

您需要使用不在全屏幕中打开的ModelPresentation表单:

troller.modalPresentationStyle = UIModalPresentationFormSheet