Add animation to an ExpandableListView

前端 未结 5 1641
星月不相逢
星月不相逢 2021-02-08 05:44

Is there a way to add animation when opening an expandable list in Android? I want it so that when the user clicks on the expandable list, it has an animation/effect like I\'m o

5条回答
  •  无人及你
    2021-02-08 06:15

    That's what i did in this situations.

    ObjectAnimator objectAnimator = ObjectAnimator.ofPropertyValuesHolder(list1, PropertyValuesHolder.ofInt("bottom", currentlistHeight,currentlistHeight*2 ));

    What this would do is that the height of the listView will get doubled and it would be animated. If you set the current list height ZERO. this would act like a drawer.

提交回复
热议问题