OSDN Git Service

Document behavior and usage of ViewGroup.bringChildToFront()
authorChet Haase <chet@google.com>
Tue, 23 Apr 2013 13:55:04 +0000 (06:55 -0700)
committerChet Haase <chet@google.com>
Wed, 24 Apr 2013 19:37:36 +0000 (12:37 -0700)
commit0187a5d424c8618709b8f11dd7200caa0178c40e
tree78b7c2fac36e337a12ad4b92743bdc54b67ae406
parent49906f17059afcd862ef8bc3b456a6ffef5ef40e
Document behavior and usage of ViewGroup.bringChildToFront()

A call to ViewGroup.bringChildToFront() or View.bringToFront()
(which delegates to the parent's bringChildToFront() method) needs
to be followed by a call to requestLayout() and invalidate() on the
parent container in order for the changes to
actually happen. That is, the order of the child views would change, but
the parent container would not run layout or even invalidation without
being told to, so there would be no visible change until something else
caused a layout and invalidation to occur.

This change clarifies this requirement in the javadocs.

Issue #8667065 bringtoTop does not work

Change-Id: Ibe41a6318dddf9fb79382e1c9fd1d21ab4510976
core/java/android/view/View.java
core/java/android/view/ViewParent.java