Now I wan开发者_如何学运维t to insert a ImageView behind the GLSurfaceView.But the GLSurfaceView always draws background color so I can't see the ImageView.I tried glClearColor(0,0,0,0)
but it doesn't work.What should I do?Please help me!
Thank you very much.
If I remember correctly you should be able to adapt this
Overlapping Views in Android
to your needs
(relative layout and android:background="#0000")
since GLSurfaceView is a View it should work.
I fixed it. using
gLSurfaceView.setEGLConfigChooser(8,8,8,8,16,0);
gLSurfaceView.setRenderer(this);
RelativeLayout rl = new RelativeLayout(this);
BgLayout bgl = new BgLayout(this);
gLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
gLSurfaceView.setZOrderOnTop(true);
rl.addView(bgl);
rl.addView(gLSurfaceView);
精彩评论