我正在尝试在另一个包含EAGL视图的视图控制器上呈现GKLeaderboardViewController。视图呈现正常但逆时针旋转父视图90度,以及破坏父视图控制器的触摸响应性和其他功能。 GKLeaderboardViewController也被解雇了。以下是用于创建父视图的代码:
viewController = [[RootViewController alloc]init];
viewController.wantsFullScreenLayout = YES;
//
// Create the EAGLView manually
// 1. Create a RGB565 format. Alternative: RGBA8
// 2. depth format of 0 bit. Use 16 or 24 bit for 3d effects, like CCPageTurnTransition
//
//
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8
depthFormat:0 // GL_DEPTH_COMPONENT16_OES
];
// attach the openglView to the director
glView.multipleTouchEnabled = YES;
[director setOpenGLView:glView];
// // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
// if( ! [director enableRetinaDisplay:YES] )
// CCLOG(@"Retina Display Not supported");
//
// VERY IMPORTANT:
// If the rotation is going to be controlled by a UIViewController
// then the device orientation should be "Portrait".
//
// IMPORTANT:
// By default, this template only supports Landscape orientations.
// Edit the RootViewController.m file to edit the supported orientations.
//
//#ifdef _ARM_NEON_
//#define ARCH_OPTIMAL_PARTICLE_SYSTEM CCQuadParticleSystem //used to be CCQuadParticleSystem
//#elif _ARM_|| TARGET_IPHONE_SIMULATOR
//#define ARCH_OPTIMAL_PARTICLE_SYSTEM CCPointParticleSystem
//#else
//#error(unknown architecture)
//#endif
[director setAnimationInterval:1.0/60];
[director setDisplayFPS:NO];
[viewController.view addSubview:glView];
[viewController.view sendSubviewToBack:glView];
[window addSubview:viewController.view];
[window setRootViewController:viewController];
[[ZGCGKHelper sharedGameKitHelper]setViewController:viewController];
[window makeKeyAndVisible];
我正在展示排行榜视图:
-(void) presentViewController:(UIViewController*)vc
{
UIViewController* rootVC = [self getRootViewController];
[[CCDirector sharedDirector] stopAnimation];
[rootVC presentViewController:vc animated:YES completion:^(void){
[[CCDirector sharedDirector] startAnimation];
}];
}
游戏中心显示的通知正确定位,不会干扰EAGLView但排行榜视图会干扰。有想法该怎么解决这个吗?升级到iOS 6后出现此问题。