How to Change StatusbarColor during the Splashscreen?


#1

Hello,
i’ve started my first App with Ionic-4. My Splachscreen is red and i have noticed that my StatusbarColor is Black during the Splashscreen, after the Splashscreen the statusbar turns to red - Is there any way to change the StatusbarColor to red during the Splashscreen or before the Splashscreen?

I have not found a solution for that issue, except that soliton :
<preference name="StatusBarBackgroundColor" value="#f50f2f" />
but this do not work before the SplashScreen only after the splash.

Have anyone an Idea how to fix this?


#2

Hi,

Did you try doing the following?
in your app.component.ts

import { StatusBar } from '@ionic-native/status-bar';
import { Platform } from "ionic-angular";
constructor(public statusBar: StatusBar, public platform: Platform,){
 this.platform.ready().then(() => {
    
   
      this.statusBar.backgroundColorByName("green");
      this.statusBar.backgroundColorByHexString('#8dc63f');

   
     
    });
}

Either by name or by hex


#3

Hello @hexation1, thanks for your prompt reply,
Yes i did that too, my StatusBarColor turns to red, but only after the SplashScreen is ending.

During the SplashScreen, my StatusBar is black…