本文没有使用三方插件,属于比较简单的启动屏配置
android
1.1 在android/app/src/main/res/values/styles.xml中配置
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
// 增加这行代码
<item name="android:windowBackground">@drawable/bootsplash_logo</item>
</style>
</resources>
1.2 增加文件夹和图片
ios
2.1 使用LaunchScreen.storyboard
- 在Xcode中打开
ios/YourProject.xcworkspace - 在项目导航器中找到
LaunchScreen.storyboard - 添加Image View并设置你的启动图片
2.2 或者使用静态图片资源
- 将启动图片添加到
Images.xcassets中的LaunchImage - 确保包含所有必要的尺寸(1x, 2x, 3x)