Frame动画是通过对多张系列帧图片的不停切换来达到视觉上的动画效果。
XML动画:
一:
<?xml version="1.0" encoding="uft-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false">
<item android:drawable="@drawable/img1" android:duration="150"/>
<item android:drawable="@drawable/img2" android:duration="150"/>
<item android:drawable="@drawable/img3" android:duration="150"/>
<animation-list />
二:
imageView img_frame;
AnimationDrawable loaclAnimation=null;
img_frame.setBackgroundResource(R.id.img_frame);
loaclAnimation=(AnimationDrawable )img_frame.getBackground();
loaclAnimation.start();
loaclAnimation.stop();
activity中: