Android Splash Screen shifts

full screen splash screen android
create splash screen android
android splash screen size
react native splash screen
flutter splash screen
android splash screen stretched
android splash screen image sizes to fit all devices
react native android splash screen white flash

I have an Android Splash Screen which renders a drawable. When it is opened via a cold start, I find that my asset simply shifts in an upward direction.

You can find the appropriate code below, all unnecessary code has been omitted.

Here's the slight shift:

SplashActivity.java

public class SplashActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = new Intent(this, MainActivity.class);
        startActivity(intent);
        finish();
    }
}

MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    SplashScreen.show(this, R.style.SplashTheme);
    super.onCreate(savedInstanceState);
}

res/drawable/background_splash.xml

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
    <item android:drawable="@color/splash_background_color"/>
    <item
        android:gravity="center"
        >
        <bitmap
            android:src="@drawable/x150"/>
    </item>
</layer-list>

res/layout/launch_screen.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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/splash_background_color">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:src="@drawable/background_splash"
        />
</FrameLayout>

res/values/styles.xml

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
    </style>
    <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/background_splash</item>
    </style>
</resources>

I found the solution:

You should remove ImageView because you've already set splash via android:windowBackground. Also remove android:background="@color/splash_background_color" from FrameLayout to make it transparent

Btw, you could delete res/layout/launch_screen.xml if you are not going to draw some layouts over your splash.

For Activity don't call setContentView()

For Fragment don't override onCreateView()

It's ok, Android doesn't require to set layout for them.

Top margin of android splash screen off by 24dp height � Issue #241 , Using this guide I saw that you have to add 24dp marginTop to properly align a center image on the splash screen to make it align properly so you don't see it shift� Launch screens can be displayed upon an app’s launch from the home screen when an app loads, instead of displaying a blank screen. Displaying a launch screen can decrease the sense of a long load time, and has the potential to add delight to the user experience. Launch screens shouldn’t be displayed if an app is running.

In styles.xml, replace:

<item name="android:windowBackground">@drawable/background_splash</item>

with

<item name="android:background">@drawable/background_splash</item>

Note the windowBackground -> background

That solves the issue for me.

Splash screen on Android jumps down during startup � Issue #47634 , Steps to reproduce: flutter create splash_bug cd splash_bug edit android/app/src/ main/res/drawable/launch_background.xml as follows: The android:lines property ensures that the title will appear on one line. The android:gravity will center the text between the top of the screen and the guideline. Don’t use wrap_content on this view - it doesn’t work with dynamic text sizing. In retrospect, this would have been easier by just including the title on the splash screen graphic.

Weird but faced same issue for my splash screen too. It was shifting upwards after some tasks were done and while opening the main activity.

But after trying out several combinations- basically i added few lines of code to fetch some data while my splash screen is shown and in that i had added a onDestroy override for cancelling my volley request queue.

@Override
    protected void onDestroy() {
        super.onDestroy();
        if (queue!= null) {
            queue.cancelAll(Constant.REQUEST_Q);
        }
    }

Once i removed the above onDestroy override the splash screen stopped shifting or moving upwards. I cant explain though why, posting this answer here this was the first post while i searched for this issue.

The (Complete) Android Splash Screen Guide, In the past, having splash screens in your Android app were not recommended. It didn't make much sense to intentionally delay the user by� Koroid is a ground-breaking, technology-enabled integrator that improves the efficiency and quality of staffing. Hospitals save money, workers earn more, patients receive better quality care, and all have a better experience. By connecting healthcare providers directly with staff, Koroid makes booking temporary shifts easier and more efficient than current practice. The Koroid app allows

Right Way to create Splash Screen on Android, As we all know splash screen is the user's first experience of your application. It normally used to display some kind of progress before the� upon opening the default text messenger after you have typed a few words, the screen shifts down to the bottom of the last message sent/received, removing your typing focus from your text box. you then have to scroll down to the type box and select inside the box to begin typing again.

Revisited — A Guide on Splash Screen in Android in 2020, A fresh look on the splash screen in Android in Kotlin and Coroutines Splash screens of some popular apps on Android Splash screen is a very� On Android, Jupiter is looking like a giant Easter egg. Windows Phone gives the same display. On the Cupertino side, we get a different but equally undesirable effect.

Android Splash Screen shifts, 问题: I have an Android Splash Screen which renders a drawable. When it is opened via a cold start, I find that my asset simply shifts in an� Giraffe Playground. Price: Free / $2.50 Giraffe Playground is a developer on Google Play. They do two live wallpaper apps. The first is a really fun clock live wallpaper.

Comments
  • Probably, it's because you have a transparent status bar. Try to add android:fitsSystemWindows="true" to your root FrameLayout
  • @TarasParshenko thank you for the suggestion, unfortunately it still exists with android:fitsSystemWindows="true">.
  • hey, i am stuck in a similar error, btw can u tell me the import line for AppCompatActivity in SplashActivity.java
  • Removing this value means it doesn't render the first time. It shows a white screen and then the logo. As appose to constantly showing the logo.
  • In this case ImageView could be removed. The issue is android:windowBackground and <ImageView android:layout_gravity="center"> render in different way. Looks like windowBackground has more space, so bitmap shifts upward
  • If I am following correctly, removing ImageView now renders nothing.
  • Yeah, you should also remove android:background="@color/splash_background_color" from FrameLayout to make it transparent
  • Thank you very much, if you could update your answer with the things in the comments I'll upvote and accept. Just a question, is launch_screen.xml required if it's only rendering a transparent FrameLayout?