OpenGLView 透明度问题

<span class=""“Apple-style-span”"" style=""“font-family:arial;line-height:normal;”""><span class=""“Apple-style-span”"" style=""“font-size:medium;”"">我新手,碰到一个棘手的问题,希望有人可以帮助我 <div style=""“font-family:arial;line-height:normal;”""><span class=""“Apple-style-span”"" style=""“font-size:medium;”"">我在cocos2d 加了一个 UIKit 控件.

由于需要,我想把OpenGLView改成透明,UIKit加到OpenGLView底下
按很多人试过的教程:

glView = EAGLView viewWithFrame:window bounds]

pixelFormat:kEAGLColorFormatRGBA8

depthFormat:0 ];

glView setMultipleTouchEnabled:YES];

glView.opaque = NO;

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

glClear(GL_COLOR_BUFFER_BIT);

overView = UIView alloc]initWithFrame:UIScreen mainScreen]bounds]];

overView.opaque = YES;

overView.backgroundColor = UIColor clearColor];

overView addSubview:glView];

viewController setView:overView];

window addSubview: viewController.view];

AppDelegate *delegate = (AppDelegate *)UIApplication sharedApplication]delegate];
openGLView]];
但是我发现我这么做完后什么都没有显示
好像我的 myView 也变成透明的了。有谁知道怎么解决这个问题吗??求助啊

1。可以考虑先不建立glview。等需要它显示得时候,再建立!或者用removesubview 和 addsubview 来操作glview,来控制它是否显示。

2。既然glview要透明,那么就把myview放置在glview上面,把glview clear得颜色即背景色设置成你想要得任何颜色,这样就到达了同样得目的。

可是 glview 一直在cocos2d 之上。我加在glview 下面的目的就是为了cocos2d的东西不被glview挡住

新的View加载window上,glView也在window上,你新加的view插入到glview之下,就可以了、、、不要直接加到glview上,否侧glview透明,子试图也会透明的、、、、

openGLView]];这样吗?我也试过。还是透明的。