問題: 僅顯示動畫列表中的第一個元素。在res動畫列表不起作用 - 僅顯示第一個元素
動畫列表繪製文件/繪製:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false" >
<item
android:drawable="@drawable/k2si"
android:duration="1000"/>
<item
android:drawable="@drawable/android"
android:duration="1000"/>
</animation-list>
啓動動畫:
ImageView image = (ImageView) findViewById(R.id.imageView1);
image.setBackgroundResource(R.drawable.screensaver_image);
((AnimationDrawable) image.getBackground()).start();
Documentation(滾動幀動畫)
你的drawables是什麼? – 2012-01-04 11:37:26
你從哪裏調用start()方法。如果它在您的活動的onCreate它不會工作。 – MikeIsrael 2012-01-04 11:44:22
@Mike - 是的,它在'onCreate()'。什麼是正確的生命週期方法來調用開始? – 2012-01-04 11:47:20