Android animation does not repeat

后端 未结 23 1497
囚心锁ツ
囚心锁ツ 2020-11-27 14:01

I\'m trying to make simple animation that would repeat several times (or infinitely).
It seems that android:repeatCount does not work!
Here is my anim

23条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 14:25

    None of the above solutions worked in my case. The solution by Danuofr did work for animation set but when I was doing unit testing, my tests used to get stuck in this infinite loop. Finally, specific to my case, I needed to repeat this animation specific number of times. So, I manually added copies of my animation in anim_rot.xml in a cascaded manner adding the offset value. I know it's bad and won't work for many but it was the only workaround for my case.

    anim_rot.xml

    
        
        
        
        
        
        
    
    

    I did this to repeat the animation 3 times. You can add more copies to repeat it specific times by adding offset values.

提交回复
热议问题