Ionic 2 can't change color of iOS statusbar


#1

I have followed the instructions in the ionic 2 docs but the code is not changing the color of my iOS status bar. The text in this bar is white and cannot be seen on the white background so I have tried to change it to black as follows:

StatusBar.overlaysWebView(true); StatusBar.styleDefault(); StatusBar.backgroundColorByName('black');

This code is in my app’s constructor. I use the following to import StatusBar:

import {StatusBar} from ‘ionic-native’;

The Cordova status bar plugin has been installed.


#2

Have you tried wrapping your code in a Platform.ready().then(…) call?


#3

Yes I did. It turns out that StatusBar.overlaysWebView(true); should have been set to false!


#4

Now the entire background color of the status bar goes invsible and the contents overlaps under the statusses