是否可以在 android 中将动画 gif 文件设置为我的应用程序的背景? [英] Is it possible to set an animated gif file as background of my app in android?

查看:28
本文介绍了是否可以在 android 中将动画 gif 文件设置为我的应用程序的背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为珠宝店做应用

我想将 gif 图像设置为我的应用程序的背景.

I want to set a gif image as background of my app.

可以设置吗?

推荐答案

是的,您可以设置 gif 图像,但这不会为您的 gif 图像设置动画.您需要明确地将 gif 图像提取到所有帧中,然后将您的图像用作 gif 动画,这里是

Yes, you can set the gif image but this will not animate your gif image. You need to explicitly extract the gif image into all frame and then using animate you image as gif here is the example of

<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:oneshot="false" >

    <item
        android:drawable="@drawable/framelayout1"
        android:duration="1000"/>

    <item
        android:drawable="@drawable/framelayout2"
        android:duration="1000"/>

    <item
        android:drawable="@drawable/framelayout3"
        android:duration="1000"/>

    <item
        android:drawable="@drawable/framelayout4"
        android:duration="1000"/>

    ....

</animation-list>

这篇关于是否可以在 android 中将动画 gif 文件设置为我的应用程序的背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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