Android: Expand/collapse animation

后端 未结 30 2496
说谎
说谎 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:43

    I stumbled over the same problem today and I guess the real solution to this question is this

    
    

    You will have to set this property for all topmost layouts, which are involved in the shift. If you now set the visibility of one layout to GONE, the other will take the space as the disappearing one is releasing it. There will be a default animation which is some kind of "fading out", but I think you can change this - but the last one I have not tested, for now.

提交回复
热议问题