Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Change the z-order of the view

Tags:

java

android

I have many views in my xml, and now I wanna change one view's z order in code in order to bring it to other views' front but not all the other views' front.

Is there any way to achieve this?

like image 269
Rocky Avatar asked Dec 07 '12 07:12

Rocky


2 Answers

The only thing that comes to mind is .bringToFront() but you would have to do it for more than one view in your case.

like image 131
RufusInZen Avatar answered Oct 13 '22 01:10

RufusInZen


This can help

layout.bringChildToFront(view);

here

layout = your_linear_layout AND 
view = the_view_you_wanna_bring_to_front

hope it will help you.

like image 44
Faizan Avatar answered Oct 13 '22 00:10

Faizan