如何在Android的windowBackground中使用.gif文件

如何在Android的windowBackground中使用.gif文件,android,Android,在应用程序开始时,我会看到android的白色屏幕。所以我用windowBackground显示了一些徽标 <style name="Theme.Splash" parent="AppTheme"> <item name="android:windowBackground">@drawable/splash_bg_loading</item> </style> @可

在应用程序开始时,我会看到android的白色屏幕。所以我用windowBackground显示了一些徽标

<style name="Theme.Splash" parent="AppTheme">
        <item name="android:windowBackground">@drawable/splash_bg_loading</item>
  </style>

@可牵引/飞溅式装载
和splash_bg_加载文件

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:drawable="@color/white"/>

    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/logo"/>
    </item>

</layer-list>


我想显示.gif文件而不是徽标。可能吗?如果是,我该怎么做?

不幸的是,您只能在SplashScreen中添加静态图像,不能在android:windowBackground中添加gif或任何动画。

不幸的是,您只能在SplashScreen中添加静态图像,不能在android:windowBackground中添加gif或任何动画

<style name="Theme.Splash" parent="AppTheme">
        <item name="android:windowBackground">@drawable/splash_bg_loading</item>
  </style>