Ionic 2 - Status Bar

2

I can not change the color of my Status Bar with Ionic 2. I checked the documentation and am doing the following.

app.js

import {StatusBar} from 'ionic-native';

app.js (constructor ())

platform.ready().then(() => {
  StatusBar.overlaysWebView(true);
  StatusBar.backgroundColorByHexString(#f69c55);
});
    
asked by anonymous 08.06.2016 / 02:39

5 answers

2

The setting is correct. However, my device was Android 5.0 and StautsBar works only on later versions, as the documentation specifies.

  

This installation method requires cordova 5.0 +

    
20.11.2016 / 12:46
1

If you refer to the Toolbar I was able to add my style to the file /src/theme/global.scss

//------- TOOLBAR //-------
    .toolbar-title-md, .bar-button-default-md, .bar-button-clear-md-default, .bar-button-md-default, .toolbar-title-ios {
        color: color($colors, minhaCor);
    }
    .toolbar-background-md, .toolbar-background-ios {
        background: none;
        border-color: transparent;
    }
    
13.11.2016 / 15:33
0

link The documentation makes the following observation:

Set the status bar to a specific hex color (CSS shorthand supported!).

iOS note: you must call StatusBar.overlaysWebView ( false ) to enable color changing.

Your ta true

    
08.08.2016 / 21:21
0
StatusBar.backgroundColorByHexString(#f69c55);

This form is incorrect because the documentation has to be a value of 'STRING'. The right way to use it is:

StatusBar.backgroundColorByHexString('#f69c55');
    
09.08.2017 / 21:47
-2

Change the true to false that will work!

    
13.11.2016 / 12:27