Android 按钮文字颜色动画
Android Button Text Color Animation
我有一个按钮。我想为按钮文本创建一个彩色动画。
我该怎么做?我如何使用 ObjectAnimator?
我用;
ObjectAnimator colorAnim = ObjectAnimator.ofInt(button, "textColor",getResources().getColor(R.color.colorPrimaryDark),getResources().getColor(R.color.colorPrimary));
colorAnim.setDuration(1000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();
我有一个按钮。我想为按钮文本创建一个彩色动画。 我该怎么做?我如何使用 ObjectAnimator?
我用;
ObjectAnimator colorAnim = ObjectAnimator.ofInt(button, "textColor",getResources().getColor(R.color.colorPrimaryDark),getResources().getColor(R.color.colorPrimary));
colorAnim.setDuration(1000);
colorAnim.setEvaluator(new ArgbEvaluator());
colorAnim.setRepeatCount(ValueAnimator.INFINITE);
colorAnim.setRepeatMode(ValueAnimator.REVERSE);
colorAnim.start();