Android: How can I stop an infinite animation applied on an ImageView?

后端 未结 3 1551
长发绾君心
长发绾君心 2020-12-09 08:41

I have an ImageView on which I have applied a rotate animation. Since I want the rotation to go on continuously, I gave the repeatCount as infinite in my rotate.xml:

相关标签:
3条回答
  • 2020-12-09 08:48

    clearAnimation() on View is best solution , it stops and reset previous state of view.

    0 讨论(0)
  • 2020-12-09 08:50

    You can also call anim.cancel(); but you should also call anim.reset(); immediately after it. Then when you want to start it again, just call startAnimation on the view.

    0 讨论(0)
  • 2020-12-09 08:59

    Use clearAnimation() to stop an animation. There is no loadAnimation() on View.

    0 讨论(0)
提交回复
热议问题