Open partha-blacknight opened 5 years ago
Hello, Maybe you could double check with this tutorial : https://medium.com/@appstud/add-a-splash-screen-to-a-react-native-app-810492e773f9
Hello quick way to add a spash screen for android is save your splash screen png(my image is full screen height) to android/app/src/main/res/drawable/splash_screen.png then edit android/app/src/main/res/values/styles.xml
`
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>
`
take a look at https://github.com/crazycodeboy/react-native-splash-screen/issues/442#issuecomment-553391344, the SplashScreen.hide() in App.js componentDidMount did the trick
Import SplashScreen from './react-native-splash-screen' in App.js, then use SplashScreen.hide() within componentDidMount()
I use wix/react-native-navigation and I used SplashScreen.hide() inside componentDidMount() but the splash screen always shows up...Then I moved it inside index.js after screen registering but it did not work as well. Please help me.
Even the bundler does not start. Just a still Screen
try to remove the app and run it again from xcode
plz check android/app/src/main/java/<your android package path>/MainActivity.java
after call react-native set-splash ...
, maybe code are changed like below.
public class MainActivity extends ReactActivity {
ReactContext reactContext;
PopupWindow popupWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashScreenTheme); SplashScreen.show(this);
super.onCreate(savedInstanceState);
SplashScreen.show(this, R.style.SplashScreenTheme); this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
// ...
remove SplashScreen.show(this, R.style.SplashScreenTheme);
like below
public class MainActivity extends ReactActivity {
ReactContext reactContext;
PopupWindow popupWindow;
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this);
super.onCreate(savedInstanceState);
this.setVolumeControlStream(AudioManager.STREAM_MUSIC);
// ...
i think maybe SplashScreen.show(this, R.style.SplashScreenTheme);
cause that issue.
I use wix/react-native-navigation and I used SplashScreen.hide() inside componentDidMount() but the splash screen always shows up...Then I moved it inside index.js after screen registering but it did not work as well. Please help me.
yeah , me too !!! I don't know if you have the answer to this, I'm having the same problem :(
Any Solution for that issue, i face the same problem
I've found a solution, in MainActivity.java file, Instead of SplashScreen.show(this, R.style.SplashScreenTheme);
or SplashScreen.show(this);
Try this SplashScreen.show(this, true);
worked like a charm, for me
any solution ?
I am using react-native-splash-screen version 3.2 . It show successfully but does not hide always show and don't load react native component screen. But I follow all the steps that declare to the plugin manual. I observe it in android platform. Please give me the solution then it's a pleasure for me.