开发者

Android - How can I get rid of the BLACK BACKGROUND of a 3D object and see the camera view?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜