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

查看:156
本文介绍了我可以将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.

将此依赖项添加到app模块中的 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天全站免登陆