Android的documentation说,你可以设置一个刷新率:如何设置PropertyAnimation的帧速率?
帧刷新延迟:您可以指定多久刷新动画的帧。默认设置为每10毫秒刷新一次,但应用程序刷新帧的速度最终取决于系统整体的繁忙程度以及系统为底层计时器提供服务的速度。
但是,它并没有告诉你如何。我到处搜索过,但在ObjectAnimator,PropertyAnimator或Animator中没有这样的方法。
编辑:我目前使用的动画更新只反应一次,每5帧 -
colorFade.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
int interpolator = 0;
@Override
public void onAnimationUpdate(ValueAnimator animation) {
if ((interpolator++) % 5 == 0)
invalidate(mHandlerBounds);
}
});
请参阅'public static void setFrameDelay(long frameDelay)' – pskink