我目前正在使用iPad並使用Cocos2D。直到現在,我剛剛在處理Game Center時使用默認視圖進行測試。我試圖現在設置它,因爲我想要它,它使用全屏幕或PageSheet(顯示在圖像中)。GKAchievementViewController全屏(或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,幾乎沒有其他東西(到目前爲止)。請,任何幫助,你可以提供將非常感激。如果你可以簡單地告訴我如何做到這一點(沒有我擁有的所有垃圾代碼),那將是完美的。
謝謝:)
我問這個,然後變得非常生病了大約一個星期左右,我回來並沒有那麼多的評論。希望一個賞金會給我一個答案:) –