iPad 游戏中心

发布于 2024-11-02 05:26:13 字数 969 浏览 0 评论 0原文

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 应用程序,它与游戏中心配合得很好。 但是当我构建 iPad 版本时,游戏中心排行榜仍然以 iPhone 尺寸( 320x480 )显示。

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

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];
}

I have a iPhone app, it works fine with gamecenter.
But when I build a iPad version, the gamecenter leaderboard still display with iPhone Size( 320x480 ).

So I added this:leaderboardController.modalPresentationStyle = UIModalPresentationFullScreen;
but the display is corrupted, the 3 buttons( today, this week, all time ) on tabbar are NOT fullscreen.
and a wood frame too.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷了相思 2024-11-09 05:26:13

您需要使用非全屏打开的 ModelPresentation 表单:

troller.modalPresentationStyle = UIModalPresentationFormSheet

you need to use the ModelPresentation Form Sheet which opens not in a full screen:

troller.modalPresentationStyle = UIModalPresentationFormSheet
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文