I'm stuck in this problem. I have a camera view and an opengl object (cube).
I want to see the 3D object while the camera is open. However, when I add two views (opengl开发者_如何学Pythonview and cameraview) if the object is on the top, it shows a black background (I can't see the camera view). If the camera is on the top, I can't see the cube....
Can someone help me?
in my Activity, I'm using this:
FrameLayout frame = new FrameLayout(this);
frame.addView(mMainGLView);
frame.addView(cameraPreview);
setContentView(frame);
But don't know why, the view that I added first is shown on the top. So here, the 3D Object is shown.
You cannot overlay two Surface Views (at least prior to 3.0) - see the response from Dianne on this thread -- essentially the z-ordering of SurfaceViews is not defined, so there is no way to tell one SurfaceView to be above another reliably.
精彩评论