gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 18:55:18 25 4
gpt4 key购买 nike

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

res/drawable 中的动画列表 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>

开始动画:

    ImageView image = (ImageView) findViewById(R.id.imageView1);
image.setBackgroundResource(R.drawable.screensaver_image);
((AnimationDrawable) image.getBackground()).start();

Documentation (滚动到帧动画)

最佳答案

请在这里查看类似的问题

Starting frame by frame animation

您将对逐帧动画有所了解。

如果您不明白,请查看下面的链接,这是使用 XML 文件逐帧动画的好教程。

frame by frame xml animation with google android

关于android - 动画列表不起作用 - 仅显示第一个元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8726172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com