关闭任何 Gamecenter 覆盖后,覆盖正确消失,我的游戏窗口再次显示,但它不响应触摸。我搜索了谷歌的答案并提出了很多建议,但没有任何效果。这是我当前的代码:
GKGameCenterViewController *gameCenterController = [[GKGameCenterViewController alloc] init];
if (gameCenterController != nil)
{
window = [[UIApplication sharedApplication] keyWindow];
gameView = [[window subviews] objectAtIndex:0];
gameCenterController.gameCenterDelegate = self;
gameCenterController.viewState = GKGameCenterViewControllerStateAchievements;
tempVC=[[UIViewController alloc] init];
[[UIApplication sharedApplication].keyWindow addSubview:tempVC.view];
[tempVC presentViewController: gameCenterController animated: YES completion:nil];
}
- (void)gameCenterViewControllerDidFinish:(GKGameCenterViewController *)gameCenterViewController
{
[tempVC dismissViewControllerAnimated:YES completion:nil];
[tempVC.view removeFromSuperview];
[tempVC release];
[window becomeFirstResponder];
[window bringSubviewToFront:gameView];
[window makeKeyAndVisible];
}