Game Center for iPad
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*)[开发者_Python百科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.
you need to use the ModelPresentation Form Sheet which opens not in a full screen:
troller.modalPresentationStyle = UIModalPresentationFormSheet
精彩评论