Reversing an Animation

前端 未结 8 471
清歌不尽
清歌不尽 2020-11-30 01:41

I have an ImageView that gets animated when it is added to a layout. When it is removed, I want to reverse the same animation.

Is there a way to reverse an animation

8条回答
  •  清歌不尽
    2020-11-30 02:06

    If you are using Object or ValueAnimator to animate the view, you can simply do

    ValueAnimator myAnimator = new ValueAnimator();  
    myAnimator.reverse()
    

    Documentation can be found here.

提交回复
热议问题