1.
<?xml version="1.0" encoding="UTF-8"?>
<animation-list android:oneshot="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="150" android:drawable="@drawable/loading_01" />
<item android:duration="150" android:drawable="@drawable/loading_02" />
<item android:duration="150" android:drawable="@drawable/loading_03" />
<item android:duration="150" android:drawable="@drawable/loading_04" />
<item android:duration="150" android:drawable="@drawable/loading_05" />
<item android:duration="150" android:drawable="@drawable/loading_06" />
<item android:duration="150" android:drawable="@drawable/loading_07" />
</animation-list>
activity中用法
public class AfActivity extends Activity implements OnClickListener {
private ImageView imageView;
private Button moveButton;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
imageView = (ImageView) findViewById(R.id.iv_imagemove);
moveButton = (Button) findViewById(R.id.move);
moveButton.setOnClickListener(this);
}
public void onClick(View v) {
// 得到配置文件中的背景文件28
imageView.setBackgroundResource(R.drawable.progress_m);
AnimationDrawable animationDrawable = (AnimationDrawable) imageView
.get