react-native-splash-screen
react-native-splash-screen copied to clipboard
Splash screen jumping up on android
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
on newest version: 2.3.0
Android only
When following the instructions, I get a good working result on iOS. On android, there is a small jump up (approx. the height of the status bar, so I suspect it has to do with that) a split second after opening the app.
I solved the jumping part by changing the default launch_screen.xml
from:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/launch_screen"
android:scaleType="centerCrop" />
</RelativeLayout>
to
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/launch_screen"
android:scaleType="centerCrop"
android:layout_marginTop="24dp" />
</RelativeLayout>
However, this results in free space with a height double that of the status bar on top that is filled by the background color. Any Idea how to fix that?
This is a common problem. Check out the following comment in the issue. I haven't tested yet, but am just about to do it:
https://github.com/crazycodeboy/react-native-splash-screen/issues/241#issuecomment-458985596
Unfortunately none of the solutions worked.
I'm facing the same issue. Haven't been able to fix it yet
Im having same issue, it seems to happen with devices with a soft navigation bar at the bottom, the Dialog that presents the splash screen is above it, but the launch screen before it is behind it, I've tried many ways to hide the soft navigation bar, but cant seem to get it to work, might have to be something that is handled in the library itself.
Using an LG Stylus 3 for testing, my Galaxy S6 with hardware buttons works fine
Im having same issue. Im added marging.
I'm getting the same "splashscreen jump".
In styles.xml , replace
<item name="android:windowBackground">@drawable/background_splash</item>
with
<item name="android:background">@drawable/background_splash</item>
Solved the issue for me.
Im having same issue
Try adding:
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
to your styles.xml under the LaunchTheme style.
android:background
this is work for me