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

后端 未结 3 1564
长发绾君心
长发绾君心 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: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.

提交回复
热议问题