Skip to content Skip to sidebar Skip to footer

Animate Layoutchanges Does Not Work Properly

I want to animate text in my textswitcher. I went through all the stack questions and the documentation, but they didn't solve my problem. Here is my XML:

Solution 1:

Here is the issue: When the TextSwitcher transitions from X lines of text to something less than X lines then the TextSwitcher's height does not change.

The TextSwitcher inherits some behavior from ViewAnimator which considers the height of all views when determining the height of the widget. The solution is to add the following XML to the TextSwitcher definition in the layout file that will inhibit this behavior:

    android:measureAllChildren="false"

Thanks to this Stack Overflow answer that states all this better than I have.

Post a Comment for "Animate Layoutchanges Does Not Work Properly"