加载不同场景时的本机背景空白轻弹

问题描述 投票:0回答:1

我正在使用适用于iOS / Android的react-native应用程序,在wix-navigation v2中具有以下结构:

SplashScreenView (stack)
   |_> if user is logged in, starts tabBasedApp (stack)
   |_> if user is not logged in, goes to AuthView (stack)

我的应用背景为绿色。因此,每当我启动该应用程序(PROD /发布)时,在加载每个场景之前,我总是看到空白的白色闪烁背景。看起来很糟糕。

应用程序开始= 1-2秒的白色加载,然后进入SplashScreen,结束SplashScreen动画,然后又一次轻弹,因为它正在加载下一个tabBased屏幕。

这是“ RootView”问题吗?如何解决此细节?

更新:在以下颜色设置中将其添加到styles.xml中后,它确实起作用了,但是无论何时我第一次打开该应用程序,我都无法解决另外1个空白卡住的情况。

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  <item name="android:colorBackground">@color/custom_theme_color</item>
</style>

一旦打开并最小化该应用程序,然后再次打开,该空白将不再发生。这是什么原因?

react-native react-native-navigation
1个回答
0
投票

这是本机启动屏幕的错误配置。正确安装并设置正确的styles.xml和colors.xml后,它就可以工作。

如果有人处于相同情况下,这是我的styles.xml文件:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/splash_gradient_bg</item>
        <item name="android:statusBarColor">@color/custom_theme_color</item>
    </style>

    <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@drawable/splash_gradient_bg</item>
        <item name="android:statusBarColor">@color/custom_theme_color</item>
    </style>

</resources>
© www.soinside.com 2019 - 2024. All rights reserved.