我有这个ObjectAnimator:
cloudAnim2 = ObjectAnimator.ofFloat(cloud2ImageView, "x",500, 1000);
cloudAnim2.setDuration(3000);
cloudAnim2.setRepeatCount(ValueAnimator.INFINITE);
cloudAnim2.setRepeatMode(ValueAnimator.RESTART);
cloudAnim2.start();
cloudAnim2.addListener(new AnimatorListener() {
@Override
public void onAnimationCancel(Animator animation) {}
@Override
public void onAnimationEnd(Animator animation) {}
@Override
public void onAnimationRepeat(Animator animation) {}
@Override
public void onAnimationStart(Animator animation) {}
});
如您所见,云将从位置500开始并将动画到位置1000,然后它将重复动画.
问题是动画越来越慢,因为它接近完成.我的意思是,运动的速度并不总是一样的.
我希望速度变得总是一样的.如何才能做到这一点?
谢谢