tags:

views:

43

answers:

1

I'm trying to set the z order of a UI element (i.e. a View) so that it will overlap another element, but calling ViewGroup.bringChildToFront() has a weird side effect....it moves the element to be the last item in the parent (the ViewGroup). Is this a bug, expected behavior, or what? More importantly, how can I set the z order or a View without this unfortunate side effect?

A: 

This is the expected behavior. bringChildToFront() just changes the index of the View inside its parent.

Romain Guy