我试图让我的gif动画上用下面的代码循环动画,但我没有任何运气显示GIF动画......使用动画绘制的问题
JAVA
ImageView img = (ImageView)findViewById(R.id.load_img);
img.setBackgroundResource(R.drawable.load_animation);
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
frameAnimation.start();
XML
<animation-list android:oneshot="false" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/load_0000" android:duration="50" />
<item android:drawable="@drawable/load_0001" android:duration="50" />
<item android:drawable="@drawable/load_0002" android:duration="50" />
<item android:drawable="@drawable/load_0003" android:duration="50" />
<item android:drawable="@drawable/load_0004" android:duration="50" />
<item android:drawable="@drawable/load_0005" android:duration="50" />
<item android:drawable="@drawable/load_0006" android:duration="50" />
<item android:drawable="@drawable/load_0007" android:duration="50" />
<item android:drawable="@drawable/load_0008" android:duration="50" />
<item android:drawable="@drawable/load_0009" android:duration="50" />
</animation-list>
任何人有任何想法,为什么它是不是动画?
噢,我的上帝有多久了我一直试图让这个该死的东西的工作...谢谢!!!!! – George 2011-12-16 17:43:33
很高兴帮助! @George – richardlin 2012-01-01 12:16:27
你能否提供完整的代码,我真的需要。 – TRonZ 2012-07-16 12:18:06