0.代碼實現
private void initShotAnim(ImageView iv) {
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator animatorX = ObjectAnimator.ofFloat(iv, "scaleX", 1f, 1.2f, 1f);
ObjectAnimator animatorY = ObjectAnimator.ofFloat(iv, "scaleY", 1f, 1.2f, 1f);
animatorX.setRepeatCount(-1);
animatorY.setRepeatCount(-1);
animatorSet.play(animatorX).with(animatorY);
animatorSet.setDuration(600).start();
}
1.使用
initShotAnim(iv);