hpique hpique - 3 years ago 208
Android Question

Defining Z order of views of RelativeLayout in Android

I would like to define the z order of the views of a RelativeLayout in Android.

I know one way of doing this is calling


Is there are better way of doing this? It would be great if I could define the z order in the layout xml.

Answer Source

The easiest way is simply to pay attention to the order in which the Views are added to your XML file. Lower down in the file means higher up in the Z-axis.

Edit: This is documented here and here on the Android developer site. (Thanks @flightplanner)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download