【问题标题】:How to prevent white background when app starts up in Jetpack compose在 Jetpack Compose 中启动应用程序时如何防止白色背景
【发布时间】:2022-11-21 13:09:41
【问题描述】:

我用 Jetpack Compose 创建了一个应用程序,并期望启动背景是黑色或其他颜色,而不是白色。这是我的 themes.xml

<style name="Theme.AlluringScreenshot" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
    <item name="android:statusBarColor">#030318</item>
    <item name="android:windowBackground">#030318</item>
    <item name="android:windowDisablePreview">true</item>
</style>

上述样式在 Android 11 和 Android 12 之前运行良好。我的应用程序在启动时仍然有白色背景。对此事有什么建议吗?

【问题讨论】:

    标签: android android-jetpack-compose android-theme android-styles android-12


    【解决方案1】:

    在 jetpack compose 仍在处理时使用启动画面 API 作为占位符

    【讨论】:

      猜你喜欢
      • 2013-01-05
      • 1970-01-01
      • 2022-11-01
      • 1970-01-01
      • 2021-10-24
      • 2021-10-01
      • 2023-03-20
      • 1970-01-01
      • 2022-06-15
      相关资源
      最近更新 更多