动画列表不起作用 - 仅显示第一个元素

Ind*_*õue 8 android android-animation

问题: 仅显示动画列表中的第一个元素.

res/drawable中的动画列表可绘制文件:

<?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>
Run Code Online (Sandbox Code Playgroud)

开始动画:

    ImageView image = (ImageView) findViewById(R.id.imageView1);
    image.setBackgroundResource(R.drawable.screensaver_image);
    ((AnimationDrawable) image.getBackground()).start();
Run Code Online (Sandbox Code Playgroud)

文档(滚动到帧动画)

Yug*_*abu 6

请在此处查看类似问题

逐帧开始动画

你会对逐帧动画有所了解.

如果您不理解,请查看下面的链接,使用XML文件逐帧动画的好教程.

逐帧xml动画与谷歌android