Stop AnimatorSet of ObjectAnimators in Android

后端 未结 2 901
逝去的感伤
逝去的感伤 2021-02-04 02:53

Im trying to stop the animation of an ImageView when a button is clicked. The animation I am using is an AnimatorSet consisting of 5 ObjectAnimat

2条回答
  •  眼角桃花
    2021-02-04 03:40

    If you had AnimatorSet listeners added, make sure you remove the listeners before cancel.

    animatorSet.removeAllListeners();
    animatorSet.end();
    animatorSet.cancel();
    

提交回复
热议问题