1

我的应用程序只支持横向,并且我只在 iOS6 的 iPhone 上遇到问题,其中 Game Center 排行榜的方向错误并且部分不在屏幕上。见附件:在此处输入图像描述

我正在使用这样的 FPPopover 从我的视图控制器调用模态 UITableView:

HighScoresController *controller = [[HighScoresController alloc] init];
FPPopoverController *popover = [[FPPopoverController alloc] initWithViewController:controller];
popover.arrowDirection = FPPopoverNoArrow;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    popover.contentSize = CGSizeMake(350,450);
else
    popover.contentSize = CGSizeMake(350,350);
popover.delegate = self;
popover.title = @"High Scores";
[popover presentPopoverFromPoint: CGPointMake(mainView.center.x, self.view.center.y + 50)];

然后,当在此表上单击其中一行时,它会调用 Game Center 中相应的排行榜:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// authenticate into game center
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
    if (error ==nil) {
        GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
        if (leaderboardController != nil)
        {
            leaderboardController.leaderboardDelegate = self;
            leaderboardController.timeScope = GKLeaderboardTimeScopeAllTime;
            leaderboardController.category = [leaderboardIDs objectAtIndex:[indexPath row]];
            [self presentViewController: leaderboardController animated: YES completion:nil];
        }
    } else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Game Center"
                                                        message:@"You need to sign into Game Center in order to view high scores" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
        [alert show];
    }

}];
}

有关如何解决此问题的任何想法?在带有 iPhone 的 iOS 5 以及适用于 iOS 5 和 6 的 iPad 上都可以。

谢谢!

4

0 回答 0