我目前正在使用iPad,并且正在使用Cocos2D。到目前为止,我只是在处理Game Center时使用默认视图进行测试。我现在正在尝试按照我想要的方式设置它,它使用全屏或PageSheet (如图所示)。
我的问题相当简单(至少在提问时是这样)。它到底为什么要这么做呢?我想不出如何访问那个“木头”框架,它正画在成就视图的顶部。

这是我一直在使用的代码(包括我一直在尝试的随机代码),以获得更大的视图。
- (void)showAchievements:(id)sender
{
GKAchievementViewController *achievements = [[GKAchievementViewController alloc] init];
if (achievements != nil)
{
achievements.achievementDelegate = self;
tempVC = [[UIViewController alloc] init];
// tempVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
// tempVC.interfaceOrientation = [[UIDevice currentDevice] orientation];
[achievements shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
[achievements shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[tempVC shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
[tempVC shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
// achievements.navigationController.modalPresentationStyle = UIModalPresentationPageSheet;
// tempVC.wantsFullScreenLayout = YES;
tempVC.modalPresentationStyle = UIModalPresentationPageSheet;
tempVC.view.superview.bounds = CGRectMake(0, 0, winSize.width, winSize.height);
// tempVC.view.superview
// tempVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
// achievements.wantsFullScreenLayout = YES;
achievements.modalPresentationStyle = UIModalPresentationPageSheet;
// achievements.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
achievements.navigationController.modalPresentationStyle = UIModalPresentationPageSheet;
// achievements. = CGRectMake(0, 0, winSize.width, winSize.height);
[[[CCDirector sharedDirector] openGLView] addSubview:tempVC.view];
[tempVC presentModalViewController:achievements animated:YES];
}
}我对UIKit的理解非常有限。我使用Cocos2D和Box2D,几乎不使用其他东西(至少到现在为止)。请,您能提供的任何帮助都将非常感谢。如果你能简单地告诉我如何正确地做这件事(没有我在那里的所有垃圾代码),那就太完美了。
谢谢您:)
发布于 2011-08-21 02:08:27
我只是试着用UIModalPresentationPageSheet来做这件事,我看到了同样的结果,不仅仅是你。这样做的“正确”方法不是改变模式视图的大小!:) Apple的UI设计者已经选择了他们想要的呈现风格和成就视图的大小;为了游戏之间的一致性,最好不要弄乱它。
发布于 2011-08-30 22:15:39
没有太多的自定义可用,如果你想要的话你需要自己获取数据并显示出来。
如果将视图大小调整为420x512,它将正确显示。
尝试如下所示:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
// The device is an iPad running iPhone 3.2 or later.
leaderboardController.view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(90.0f));
leaderboardController.view.bounds = CGRectMake(0, 0, 420, 512);
//leaderboardController.view.center = CGPointMake(240, 160);
leaderboardController.view.center = CGPointMake(364, 512);https://stackoverflow.com/questions/6985497
复制相似问题