6
我有这个ObjectAnimator:如何用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,然后它会重复动画。
问题是动画越来越慢,因为它接近完成。我的意思是,运动的速度并不总是相同的。
我希望速度总是一样的。如何才能做到这一点?
感谢
当使用KeyFrames,PVH和ObjectAnimator.ofPropertyValuesHolder进行复杂的重复动画时,我得出了完全相同的结论。 我总是认为ObjectAnimator将完全依赖于KeyFrame中的动画设置,但我真的很惊讶地看到默认的AccelerateDecelerateInterpolator。 – Mattias