Transparent SurfaceView on the Toolbar

1

I'm drawing a graph, and for this I am using a Class that extends from SurfaceView .

The screen where it will be drawn has a background image. So, to make SurfaceView transparent, I did the following:

 setBackgroundColor(Color.TRANSPARENT);
 setZOrderOnTop(true);
 surfaceHolder = getHolder();
 surfaceHolder.setFormat(PixelFormat.TRANSPARENT);

It worked! the area of SurfaceView was transparent, but when I scroll on the screen, SurfaceView is above Toolbar .

I think it's due to the following line:

setZOrderOnTop(true);

But if I remove, or hedge like false the background turns black!

How can I make a SurfaceView transparent and keep Z below Toolbar ?

    
asked by anonymous 08.02.2017 / 18:58

0 answers