【发布时间】:2020-08-30 03:33:01
【问题描述】:
是否可以在我的初始屏幕布局中加载 Lottie 动画?
目前我的启动画面布局是这样的:
背景.xml
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:opacity="opaque">
<item android:drawable="@drawable/path_background_gradient" />
<item
android:drawable="@drawable/ic_locky"
android:gravity="center" />
</layer-list>
styles.xml
<!-- Splash Launcher UI theme. -->
<style name="Locky.Theme.Launcher" parent="Locky.Theme">
<item name="android:windowBackground">@drawable/custom_background_launcher</item>
<item name="colorPrimary">@color/background_gradient_accent_start</item>
<item name="colorPrimaryDark">@color/background_gradient_accent_start</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
我用它来防止 android 冷启动时出现白屏。
但我想使用 Lottie 动画而不是图标 ic_locky。有可能这样做吗?因为有很多应用在启动画面中使用动画徽标。
【问题讨论】:
标签: android kotlin splash-screen lottie