我創建animation.xml文件,在其中我已經加了我幀動畫的東西,但它不工作我在活動課叫5這爲後續....動畫的android
animation = (ImageView)findViewById(R.id.imageAnimation);
animation.setBackgroundResource(R.drawable.animation); // the frame-by-frame animation defined as a xml file within the drawable folder
AnimationDrawable frameAnimation =
(AnimationDrawable) animation.getBackground();
frameAnimation.start();
能任何一個可以告訴我什麼該
animation.xmal文件是問題
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/anatomy_5" android:duration="50" />
<item android:drawable="@drawable/anatomy_6" android:duration="50" />
<item android:drawable="@drawable/anatomy_7" android:duration="50" />
<item android:drawable="@drawable/anatomy_8" android:duration="50" />
<item android:drawable="@drawable/anatomy_9" android:duration="50" />
<item android:drawable="@drawable/anatomy_10" android:duration="50" />
<item android:drawable="@drawable/anatomy_11" android:duration="50" />
<item android:drawable="@drawable/anatomy_12" android:duration="50" />
<item android:drawable="@drawable/anatomy_13" android:duration="50" />
<item android:drawable="@drawable/anatomy_14" android:duration="50" />
<item android:drawable="@drawable/anatomy_15" android:duration="50" />
<item android:drawable="@drawable/anatomy_16" android:duration="50" />
<item android:drawable="@drawable/anatomy_17" android:duration="50" />
<item android:drawable="@drawable/anatomy_18" android:duration="50" />
<item android:drawable="@drawable/anatomy_19" android:duration="50" />
<item android:drawable="@drawable/anatomy_20" android:duration="50" />
<item android:drawable="@drawable/anatomy_21" android:duration="50" />
<item android:drawable="@drawable/anatomy_22" android:duration="50" />
<item android:drawable="@drawable/anatomy_23" android:duration="50" />
<item android:drawable="@drawable/anatomy_24" android:duration="50" />
<item android:drawable="@drawable/anatomy_25" android:duration="50" />
<item android:drawable="@drawable/anatomy_26" android:duration="50" />
<item android:drawable="@drawable/anatomy_27" android:duration="50" />
<item android:drawable="@drawable/anatomy_28" android:duration="50" />
<item android:drawable="@drawable/anatomy_29" android:duration="50" />
<item android:drawable="@drawable/anatomy_30" android:duration="50" />
<item android:drawable="@drawable/anatomy_31" android:duration="50" />
<item android:drawable="@drawable/anatomy_32" android:duration="50" />
<item android:drawable="@drawable/anatomy_33" android:duration="50" />
<item android:drawable="@drawable/anatomy_34" android:duration="50" />
<item android:drawable="@drawable/anatomy_35" android:duration="50" />
<item android:drawable="@drawable/anatomy_36" android:duration="50" />
<item android:drawable="@drawable/anatomy_37" android:duration="50" />
<item android:drawable="@drawable/anatomy_38" android:duration="50" />
<item android:drawable="@drawable/anatomy_39" android:duration="50" />
<item android:drawable="@drawable/anatomy_40" android:duration="50" />
<item android:drawable="@drawable/anatomy_41" android:duration="50" />
<item android:drawable="@drawable/anatomy_42" android:duration="50" />
<item android:drawable="@drawable/anatomy_43" android:duration="50" />
<item android:drawable="@drawable/anatomy_44" android:duration="50" />
<item android:drawable="@drawable/anatomy_45" android:duration="50" />
<item android:drawable="@drawable/anatomy_46" android:duration="50" />
<item android:drawable="@drawable/anatomy_47" android:duration="50" />
<item android:drawable="@drawable/anatomy_48" android:duration="50" />
<item android:drawable="@drawable/anatomy_49" android:duration="50" />
</animation-list>
試試這個http://stackoverflow.com/questions/2785336/starting-frame-by-frame-animation –