以原始状态停止Android动画

时间:2011-07-11 08:10:04

标签: android android-animation

我有一个动画旋转的ImageButton。

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"  >
    <rotate
        android:fromDegrees="0"  
        android:toDegrees="360"  
        android:pivotX="50%"  
        android:pivotY="50%"  
        android:repeatCount="infinite"  
        android:duration="2000" />
</set>

它在用户单击它并运行AsyncTask时启动。现在,在AsyncTask到达PostExecute之后,它突然跳转到原始状态并停止。

我可以避免那种突然跳跃并继续旋转直到它到达原来的位置然后让它停在那里吗?

我正在使用它来立即停止PostExecute的动画:

refresh.getAnimation().cancel();

谢谢!

1 个答案:

答案 0 :(得分:0)

原来这很简单。 我通过电子邮件发送了Catch Notes开发人员,因为这是受到他们应用的启发。

refresh.getAnimation().setRepeatCount(0);
PostExecute上的

相关问题