Android animation does not repeat

后端 未结 23 1491
囚心锁ツ
囚心锁ツ 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:29

    i got this to go ...i was trying to get a view to rotate in a circle continuously .

    previous i was using rotation.setRepeatMode(-1) but that didn't work. switched to setrepeatcount and it works. This is on jelly bean 4.2.2

     ObjectAnimator rotation = ObjectAnimator.ofFloat(myview,
                              "rotation", 360).setDuration(2000);
                    rotation.setRepeatMode(-1);
              rotation.setRepeatCount(Animation.INFINITE); 
     rotation.start();
    

提交回复
热议问题