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

 

posted @ 2013-09-09 18:40  冰雨的日子  阅读(876)  评论(0编辑  收藏  举报