Is it possible to set an animated gif file as background of my app in android?

前端 未结 2 1811
甜味超标
甜味超标 2021-01-07 14:21

I am doing app for Jewellery shop

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

Is it possible to set?

相关标签:
2条回答
  • 2021-01-07 15:09

    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>
    
    0 讨论(0)
  • 2021-01-07 15:12

    Why should this be different from using animated Gifs anywhere else on Android? The answer is - it's exactly the same.

    Here is how to display animated gifs on Android: Display Animated GIF

    0 讨论(0)
提交回复
热议问题