我可以添加 GIF 格式的图像作为启动画面吗 [英] Can I Add GIF format Image as a Splash Screen

查看:39
本文介绍了我可以添加 GIF 格式的图像作为启动画面吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何添加 GIF 格式的图像作为启动画面.我试图添加,但是当我添加它时.它充当普通图像.我不知道我们是否可以使用 Gif 图像作为启动画面.如果有任何选项可以处理该 GIF 格式的图像.

How can i add GIF format image as a splash screen. I tried to add but when i add it. It acts as a normal image. I don't know whether we can use Gif image as splash Screen. if there is any option to work that GIF format image.

推荐答案

是的,您可以为启动画面添加 Gif 图像.在您的视图中使用 Gif 图像.

Yes, you can Add Gif Image for the Splash Screen. To use Gif Image in your View.

将此依赖项添加到应用模块中的 build.gradle 文件中.

add this dependency to your build.gradle file in the app module.

最新版本.

dependencies {
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.10'
}

并在 XML 文件中添加这种方式

and In the XML file add this way

<pl.droidsonroids.gif.GifTextView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/yourgif_image"
    />

并将您的 Gif 图像添加到 Drawable.

and add your Gif Image to Drawable.

有关更多详细信息,请访问:https://github.com/koral--/android-gif-drawable

For more detail visit this: https://github.com/koral--/android-gif-drawable

您可以为图像创建不同的框架,并在很短的时间间隔内逐个添加.

you can Create different Frame for Image and add it one after another in short interval of time.

这篇关于我可以添加 GIF 格式的图像作为启动画面吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆