Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a SurfaceView transparent without setZOrderOnTop(true)

I have a RelativeLayout containing a custom SurfaceView and other elements that must be drawn over the SurfaceView. I also need the SurfaceView to be transparent. I tried this answer: how to make surfaceview transparent. But with the setZOrderOnTop(true) the other elements over the SurfaceView in the RelativeLayout are shown above the Surface (and partially hidden if the surface have something paint).

How can I solve this problem? thanks

like image 966
Addev Avatar asked Nov 19 '12 14:11

Addev


1 Answers

Set the holder pixel format to RGBA_8888,

sv.setZOrderOnTop(true);    //very much necessary

getHolder().setFormat(PixelFormat.RGBA_8888);

like image 99
e7fendy Avatar answered Nov 06 '22 00:11

e7fendy