ifeoluwa king
ifeoluwa king

Reputation: 531

How to completely eliminate blank whitescreen in ionic 2 project

When the splashscreen finishes loading, the app sometimes go blank and I have to press the home key and open the app again before it works. This happens frequently enough to make it very annoying. Please how can I get rid of it completely. Have seen other solutions but they didn't work for me. Am building for Android.

Upvotes: 2

Views: 200

Answers (1)

Jorgesys
Jorgesys

Reputation: 126563

To avoid the blank screen you can use a theme related to your Activity, for example :

 <style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/fondo_splash</item>
   </style>

into the android:windowBackground property you must define a backgroud that will be present all the time, for example an image (stored into @drawable/ )

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

or a color (@color/):

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

Inside our AndroidManifest.xml we can define the theme for our application :

  <application
        android:theme="@style/SplashTheme">

o an specific Activity:

<activity android:name=".SplashScreenActivity"
   android:theme="@style/SplashTheme" >

With this we can assure to have a background (drawable or color), and avoid the blank screen.

introducir la descripción de la imagen aquí

Upvotes: 1

Related Questions