TextView - 减少数字的动画
TextView - Animation for decreasing numbers
我正在尝试为 TextView 创建动画,其中数字 decrease/increase 如下所示:
我该怎么做?有没有人知道的图书馆?
使用ValueAnimator:
private void startCountAnimation() {
ValueAnimator animator = ValueAnimator.ofInt(0, 600);
animator.setDuration(5000);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
textView.setText(animation.getAnimatedValue().toString());
}
});
animator.start();
}
我正在尝试为 TextView 创建动画,其中数字 decrease/increase 如下所示:
我该怎么做?有没有人知道的图书馆?
使用ValueAnimator:
private void startCountAnimation() {
ValueAnimator animator = ValueAnimator.ofInt(0, 600);
animator.setDuration(5000);
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
textView.setText(animation.getAnimatedValue().toString());
}
});
animator.start();
}