gpt4 book ai didi

android - 在 Android Studio 项目上运行 gifImageView

转载 作者:行者123 更新时间:2023-11-30 00:31:52 25 4
gpt4 key购买 nike

我最近下载了一个 gif 图像以将其插入到我的新 Android Studio 项目中。下载后,我将 .gif 文件复制到 drawable 文件夹中。我称之为“图像”。在 activity_main 布局的“文本”部分,我这样写:

<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/image"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"
app:layout_constraintVertical_bias="0.498"
android:layout_marginRight="8dp"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_bias="0.595" />

表面上没有问题......但是当我启动我的应用程序时,gif 不起作用。它像 .jpg 文件图像一样是静态的。如何在我的 Android 手机上的应用程序中播放我的 .gif 图像?

最佳答案

好吧,使用 imageview 不会做你想做的事。不过,有几种方法可以查看 gif。 example link或者你可能只是想使用 library .

关于android - 在 Android Studio 项目上运行 gifImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44203858/

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