How does one Animate Layout properties of ViewGroups?

后端 未结 3 1156
别那么骄傲
别那么骄傲 2020-12-15 01:07

I have the following layout:




        
3条回答
  •  伪装坚强ぢ
    2020-12-15 01:35

    Just adding my 2 cents here to Knickedi's excellent answer - just in case someone needs it:

    If you animate using weights you will end up with issues with clipping/non-clipping on contained views and viewgroups. This is especially true if you use viewgroups with weight as fragment containers. To overcome it, you might as well need to animate margins of the problematic child views and viewgroups / fragment containers.

    And, to do all these things together, its always better to go for ObjectAnimator and AnimatorSet (if you can use them), along with some utility classes like MarginProxy

提交回复
热议问题