View围绕中心点旋转,直接上代码:
final ObjectAnimator animator = ObjectAnimator.ofFloat(imageView, "rotation", 0f, 360f);
LinearInterpolator lin = new LinearInterpolator();
animator.setInterpolator(lin);
animator.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
//旋转结束后,执行递归,继续旋转
setAnimator(imageView);
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
//旋转速度
animator.setDuration(7000);
//开启动画
animator.start();