<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false"
>
<item android:drawable="@drawable/black" android:duration="200" />
<item android:drawable="@drawable/cyan" android:duration="200" />
<item android:drawable="@drawable/green" android:duration="200" />
<item android:drawable="@drawable/magenta" android:duration="200" />
<item android:drawable="@drawable/navy" android:duration="200" />
<item android:drawable="@drawable/orange" android:duration="200" />
<item android:drawable="@drawable/pink" android:duration="200" />
<item android:drawable="@drawable/white" android:duration="200" />
<item android:drawable="@drawable/yellow" android:duration="200" />
</animation-list>

imageView = (ImageView) findViewById(R.id.ImageButton01);        imageView.setOnClickListener(new OnClickListener() {            @Override            public void onClick(View v) {                AnimationDrawable animator = (AnimationDrawable) imageView.getBackground();                imageView.setImageDrawable(null);                animator.start();            }        });

/ Call this method to stop the animation    public void stopAnimation(){        AnimationDrawable animator = (AnimationDrawable) imageView.getBackground();        animator.stop();        imageView.setImageResource(R.drawable.icon);    }

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android图片旋转实例
  2. Android中的android:layout_weight讲解
  3. Android(安卓)ScrollView 去掉 scrollbar
  4. Android(安卓)API等级、Android版本、发
  5. PULL解析XML
  6. Android(安卓)应用Crash 后自动重启
  7. Android文件列表RecyclerView中点击视频
  8. Android禁止下拉状态栏
  9. Android(安卓)之应用程序重启
  10. Android(安卓)9.0 P 状态栏下移的实现