是否有可能设置GIF动画文件作为我的Android应用程序的背景是什么?
问题描述:
我在做应用程序的珠宝店。
I am doing app for Jewellery shop
我要设置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>