ImageView 呼吸动画

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);

 

你可能感兴趣的:(特效)