我们从react-native-bootsplash-v4迁移到react-native-bootsplash-v6以获得dark-splash支持。 CLI 使用提供的徽标生成所需的资产。背景颜色发生了变化,但是我们在生成资产时得到了不同的徽标,而不是参数中使用的徽标
一些可能有用的信息:
此问题仅发生在 Android 上
以下更改解决了该问题
<!-- BootTheme should inherit from Theme.BootSplash or Theme.BootSplash.EdgeToEdge -->
<style name="BootTheme" parent="Theme.BootSplash">
<item name="bootSplashBackground">@color/bootsplash_background</item>
<item name="bootSplashLogo">@drawable/bootsplash_logo</item>
<item name="postBootSplashTheme">@style/AppTheme</item>
<!-- The following code helps in hiding the white circle that comes up in bootsplash-->
<item name="android:windowDisablePreview">true</item>
<item name="android:windowIsTranslucent">true</item>
</style>
MainActivity.java
- RNBootSplash.init(this);
- RNBootSplash.init(this, R.style.BootTheme);
来源:https://github.com/zoontek/react-native-bootsplash/blob/5.5.3/MIGRATION.md