我有以下 XML 文件来定义我的帧动画:
<animation-list
xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/youme_blink_frame_0000" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0001" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0002" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0003" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0004" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0005" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0006" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0007" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0008" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0009" android:duration="40" />
<item android:drawable="@drawable/youme_blink_frame_0010" android:duration="40" />
</animation-list>
然后我有以下代码:
Animation mAnim = AnimationUtils.loadAnimation(this, R.anim.blink);
mAnim.setAnimationListener(this);
ImageView img = (ImageView)findViewById(R.id.animationImage);
img.clearAnimation();
img.setAnimation(mAnim);
img.startAnimation(mAnim);
此代码生成异常,错误为“找不到动画文件”。是帧动画不被认为是动画还是我做错了什么?
谢谢,西蒙