react-native-splash-screen icon indicating copy to clipboard operation
react-native-splash-screen copied to clipboard

Splash screen jumping up on android

Open schumannd opened this issue 5 years ago • 11 comments

  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.

schumannd avatar Apr 09 '19 13:04 schumannd

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?

schumannd avatar Apr 09 '19 14:04 schumannd

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

SimonErich avatar Apr 09 '19 17:04 SimonErich

Unfortunately none of the solutions worked.

schumannd avatar Apr 26 '19 14:04 schumannd

I'm facing the same issue. Haven't been able to fix it yet

otaviogaiao avatar Apr 29 '19 11:04 otaviogaiao

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

jacquesyoco avatar Jul 08 '19 11:07 jacquesyoco

Im having same issue. Im added marging.

EvgenBES avatar Aug 11 '19 08:08 EvgenBES

I'm getting the same "splashscreen jump".

mayconmesquita avatar Oct 07 '19 00:10 mayconmesquita

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.

varnika8896 avatar Dec 17 '19 06:12 varnika8896

Im having same issue

David-moonsite avatar Sep 09 '20 13:09 David-moonsite

Try adding:

    <item name="android:windowDrawsSystemBarBackgrounds">true</item>

to your styles.xml under the LaunchTheme style.

yanivshaked avatar Feb 08 '21 07:02 yanivshaked

android:background

this is work for me

udayarajurs avatar Jul 31 '23 10:07 udayarajurs