Forum Xamarin Xamarin.Forms

Splash screen exhibiting abrupt motion before switching to the main screen

hecatehecate Member ✭✭

A splash screen implemented to be displayed while the Xamarin app loads in the background exhibits an unanticipated "upwards movement" while being displayed before switching to the main screen in Android devices (as seen in the following GIF of the loading screen).

My first assumption regarding the solution of this issue was to use the same style settings for both the splash screen activity and the main activity but it is to no avail as the unwanted motion is still exhibited, which, as of this moment, is completely baffling as the cause just cannot be segregated.

The splash screen is implemented as per the logic corresponding to the following code and style sheets in the Android Project:


<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="">
    <color android:color="@color/splash_screen_background"/>
  <!-- For bitmap images -->
  <!-- For Android's drawable vector images -->
    android:gravity ="center"
    android:height="214.010dp" />


<?xml version="1.0" encoding="utf-8"?>
    <color name="launcher_background">#FFFFFF</color>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="splash_screen_background">#FFFFFF</color>


<?xml version="1.0" encoding="utf-8" ?>

  <style name="MainTheme" parent="MainTheme.Base">
  <!-- Base theme applied no matter what API -->
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
    <item name="windowNoTitle">true</item>
    <!--We will be using the toolbar so no need to show ActionBar-->
    <item name="windowActionBar">false</item>
    <!-- Set theme colors from -->
    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">#2196F3</item>
    <!-- colorPrimaryDark is used for the status bar -->
    <item name="colorPrimaryDark">#1976D2</item>
    <!-- colorAccent is used as the default value for colorControlActivated
         which is used to tint widgets -->
    <item name="colorAccent">#FF4081</item>
    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight and colorSwitchThumbNormal. -->
    <item name="windowActionModeOverlay">true</item>

    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>

  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
    <item name="colorAccent">#FF4081</item>

  <style name="SplashScreenTheme" parent ="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowBackground">@drawable/splash_screen</item>
    <item name="android:windowNoTitle">true</item>  
    <item name="android:windowFullscreen">true</item>  
    <item name="android:windowContentOverlay">@null</item>  
    <item name="android:windowActionBar">false</item>
    <item name="windowActionModeOverlay">true</item>

Attributes to the Android Activity class pertaining to the splash screen:

[Activity(Label = "App_App1", 
        Theme = "@style/SplashScreenTheme",
        Icon = "@mipmap/icon",
        ConfigurationChanges = ConfigChanges.ScreenSize 
                                | ConfigChanges.Orientation,
        MainLauncher = true, 
        NoHistory = true,
        ScreenOrientation = ScreenOrientation.Portrait

Thanks in advance.


  • jezhjezh Member, Xamarin Team Xamurai

    Sorry,I did a test according to your code,but I couldn't reproduce this question on our side.

    Could you please post a basic demo so that we can try to test on our side?

  • hecatehecate Member ✭✭

    Removing the parent attribute of the <style> tag adhering to the splash screen (i.e. the <style> tag with the attribute name="SplashScreenTheme", in this case) removes the unwanted behavior.

Sign In or Register to comment.