Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put a layout on top of layout.setZOrderOnTop()

Tags:

android

I've a SurfaceView for a book for pagecurl. I wanted it to be transparent for some reasons and I've used

myView.setZOrderOnTop()

to achieve it. Till now, everything is working perfectly.

Now I need to put some views (suppose an ImageView) on top of this surfaceview (book). When I do so, the imageview is hidden behind the book. The part of it that is outside book bounds, is visible as expected. I've added the imageview in last of XML but don't find a way to change the z order of imageview so that it becomes visible on book.

Please suggest me a way to achieve this.

NOTE: I can't remove setZOrderOnTop() unless there is any other solution to make my surface view transparent.

like image 464
Umair Avatar asked Sep 12 '13 10:09

Umair


1 Answers

I don't know your code but hope it will help you:

view1.setZOrderOnTop(false);        
view2.setZOrderOnTop(true);
view2.setZOrderMediaOverlay(true);

In my case:

enter image description here

Try to play with this,

see reference of setZOrderMediaOverlay here

like image 124
Maxim Shoustin Avatar answered Sep 22 '22 12:09

Maxim Shoustin