Android: Expand/collapse animation

后端 未结 30 2486
说谎
说谎 2020-11-22 05:01

Let\'s say I have a vertical linearLayout with :

[v1]
[v2]

By default v1 has visibily = GONE. I would like to show v1 with an expand animat

30条回答
  •  难免孤独
    2020-11-22 05:36

    An alternative is to use a scale animation with the following scaling factors for expanding:

    ScaleAnimation anim = new ScaleAnimation(1, 1, 0, 1);
    

    and for collapsing:

    ScaleAnimation anim = new ScaleAnimation(1, 1, 1, 0);
    

提交回复
热议问题