0

I am beginner in ionic 2.

How to hide status bar when showing splashscreen in android platform.

Here is my component.

app opened show splashscreen.and does not changes the status bar color.

splashscreen hide.after changes the status bar color.

this.platform.ready().then(() => {
   this.Status.backgroundColorByHexString("#0e5591");
      Splashscreen.hide();
})

I need changes status bar color during splashscreen when showing.

Kindly advice me.

Thanks

Anivaishu
  • 243
  • 1
  • 3
  • 9
  • Make activity full screen – Piyush Mar 23 '17 at 11:13
  • Possible duplicate of [Android transparent status bar and actionbar](http://stackoverflow.com/questions/29907615/android-transparent-status-bar-and-actionbar) – Rabindra Acharya Mar 23 '17 at 11:14
  • Thanks for ur reply.my app opened.show splashscreen and.does not change the statusbar color.and same time hide splashscreen.after changes the status bar color.I need show splashscreen with status bar color change. – Anivaishu Mar 23 '17 at 11:19
  • Not understanding your question properly, can you please make it clear? @Anivaishu – Pratik Dasa Mar 23 '17 at 11:22
  • @Pratik Dasa . I update my question.Kindly check it. – Anivaishu Mar 23 '17 at 11:29
  • Sorry I dont know about ionic, I am a native android developer. @Anivaishu you can drop me an email if you want any help in native. – Pratik Dasa Mar 23 '17 at 11:33

2 Answers2

0

You can use below code to set statusbar color programmatically:

 Window window = getWindow();
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
    window.setStatusBarColor(ContextCompat.getColor(this, R.color.transparent));
}
Mayura Devani
  • 440
  • 3
  • 17
0

For Android, adding following in styles.xml changes status bar color. (I'm showing status bar with white background)

    <style name="AppTheme.NoActionBar" parent="Theme.AppCompat.NoActionBar">
        <item name="android:statusBarColor">@android:color/white</item>
    </style>

    <style name="AppTheme.NoActionBarLaunch" parent="AppTheme.NoActionBar">
        <item name="android:statusBarColor">@android:color/white</item>
    </style>
Jose
  • 2,479
  • 1
  • 20
  • 17