Android 属性动画中心点无限循环

属性动画旋转

ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(img, "rotation", 360);
//objectAnimator.setRepeatMode(ValueAnimator.REVERSE);  播放完毕直接翻转播放
//objectAnimator.setRepeatMode(ValueAnimator.RESTART);  播放完毕直接从头播放
objectAnimator.setRepeatCount(ObjectAnimator.REVERSE);
//setRepeatCount如何设置为无数次呢
objectAnimator.setRepeatCount(Animation.INFINITE);
//线性插值期
objectAnimator.setInterpolator(new LinearInterpolator());
objectAnimator.setDuration(2000);
objectAnimator.start();

你可能感兴趣的:(Android常用)