我想添加一个旋转drawable作为一个按钮 drawableRight
但它不旋转 . 这是我试图使用的代码 .
Drawable loader = ContextCompat.getDrawable(getActivity(), R.drawable.ic_rotate_right);
ObjectAnimator rotateAnim = ObjectAnimator.ofFloat(loader,
"rotation", 0f, 360f);
rotateAnim.setDuration(500);
rotateAnim.setRepeatCount(ValueAnimator.INFINITE);
rotateAnim.setRepeatCount(ValueAnimator.RESTART);
rotateAnim.start();
simpleButton.setCompoundDrawablesWithIntrinsicBounds(null, null, loader, null);
请问你知道如何实现这一目标吗?
Note: drawable是一个矢量drawable .