7

By default, the max size of all children is used as the VeiwAnimator's layout size. How to create ViewAnimator, which height changes depending on the size of displaying child?

1 Answers1

13

Either by specifying the android:measureAllChildren="false" as a ViewAnimator XML attribute or viewAnimator.setMeasureAllChildren(false) in code.

Tadej
  • 2,901
  • 1
  • 17
  • 23
  • 3
    [Android Documentation](http://developer.android.com/reference/android/widget/FrameLayout.html#setMeasureAllChildren%28boolean%29) says "Defaults to false", but default was true! :| – Alireza Mirian Mar 31 '14 at 03:38