Android ImageView添加动画

方法1:
 
animation.xml
 
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false">
    <item android:duration="500" android:drawable="@drawable/broadcast_actionbar_invisble" />
    <item android:duration="500" android:drawable="@drawable/broadcast_actionbar_visible" />
 
</animation-list>
 
 image.setBackgroundResource(R.anim.animation);
 
 
方法2:
 
image.setImageResource(R.anim.animation);
mAnimationDrawable = (AnimationDrawable) mProgressBar
                        .getDrawable();
                mAnimationDrawable.start();
 
mAnimationDrawable.stop();

 

原文地址:https://www.cnblogs.com/bing11/p/3310400.html