伙计。我有这样的代码(的AsyncTask)RotateAnimation无持续时间
我的动画()函数:
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);// i want rotating without this <------------------
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
谁能告诉我这是可能做到这一点,而不anim.setDuration
???? 只是开始..当我按下按钮(例如)动画停止。 请帮帮我。 问候,彼得。
最终代码:
public void animation()
{
int currentRotation = 0;
anim = new RotateAnimation(currentRotation, (360*4),
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,0.5f);
currentRotation = (currentRotation + 45) % 360;
anim.setInterpolator(new LinearInterpolator());
anim.setDuration(4000);
// anim.setRepeatMode(Animation.INFINITE);
anim.setRepeatCount(Animation.INFINITE);
anim.setFillEnabled(true);
anim.setFillAfter(true);
refresh.startAnimation(anim);
}
和地方refresh.clearAnimation();
为停止动画 这对我的工作完美..如果这里有些东西错了 - 请告诉我..总之谢谢你的答案:)
谢谢你,老兄。这非常有帮助 – Peter 2011-06-02 13:58:00