react native splash screen implementation
A react native application comes with a default splash screen which contains a text in the center with the app title and a text at the bottom which says it is powered by react native. This splash screen can be customized with some changes to the native code in IOS and Android.
To update the splash screen for Android:
1. Create a layout file with the design you would like to show on your splash screen. Here is an example layout file android/app/src/main/res/layout/splash_screen.xml
2. Add this line to the onCreate function in MainActivity.java
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splash_screen); }
3. Do a clean and reinstall the app
cd android ./gradlew clean cd.. react-native run-android
To update the splash screen for IOS:
1. Open XCode and find the LaunchScreen storyboard, update the UI on the storybord with anything you like.
2. Reinstall the app
react-native run-ios
Here is another way to update the splash screen for Android.
Here is another way to update the splash screen for IOS.
TiCons is a website where you can generate a splash screen by uploading a image.
Search within Codexpedia
Search the entire web