0

我有一个动画旋转 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();

谢谢!

4

1 回答 1

0

事实证明这很简单。我给 Catch Notes 开发人员发了电子邮件,因为这是从他们的应用程序中获得的灵感。

refresh.getAnimation().setRepeatCount(0);

在执行后。

于 2011-07-11T20:04:50.490 回答