How to create ImageView pulse effect using nine old androids animation

后端 未结 3 1447
悲哀的现实
悲哀的现实 2021-01-30 08:57

I wonder how I should create a pulse effect using nine olad androids framework animation.

To understand better lets say you have an ImageView and want to have a \"pulse\

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-30 09:41

    heart_pulse.xml put heart_pulse.xml in res/anim folder Add android:interpolator

    then use in your activity like below

    
    
    
    ImageView imageView =(ImageView)findViewById(R.id.imageView);
    Animation pulse = AnimationUtils.loadAnimation(this, R.anim.heart_pulse);
    imageView.startAnimation(pulse);
    

提交回复
热议问题