簡體   English   中英

如何修復啟動畫面后出現的白屏 - 反應原生

[英]How to fix the white screen it appears after splash screen - react native

我有一個問題,即在啟動畫面加載和應用程序啟動后出現白屏。

我已經嘗試過一些代碼並使用 js 和本機,但不起作用

   componentwillmount{
 splashscreen.hide();
}

在 Android 的情況下,將 android:windowDisablePreview 放入你的 styles.xml。 我希望它會幫助你。

<!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowDisablePreview">true</item>
        <item name="colorPrimaryDark">@color/status_bar_color</item>
        <!-- Customize your theme here. -->
    </style>

也請嘗試以下代碼。

componentDidMount() {
    setTimeout(() => {
      SplashScreen.hide()
    }, 300)
} 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM