Skip to content
Guillaume Gendre edited this page Apr 29, 2019 · 4 revisions

status bar

what is this ?

status bar properties

property type default value description
visible Boolean true status bar visibility
lightText Boolean false on iOS. true on Android text color can be dark or light.

status bar color

On android status bar color is black by default. It will automatically be darker than the color you specified in native bars or as backgroundColor in cobalt.json. You can still change this color manually in your native app android styles by setting the [COMPLETE THIS] style.

On iOS status bar color is white by default. Its background color will be the same than the color you specified in native bars or as backgroundColor in cobalt.json.

Setting status bar in cobalt.json

You can set the status bar visibility straight from the cobalt.json

Quick exemple :

statusBar : {
    visible : true,
    lightText : true
}

Changing status bar from javascript

You can change status bar visibility and text color like this :

cobalt.statusBar.set({ visible: true, lightText : false});

Changing status bar in navigation calls

It can be set from navigation calls too for push, modal, adn replace.

cobalt.navigation.push({
   page : 'myPage.html',
   controller : 'myController',
   statusBar: {visible: true, lightText : false}
});
Clone this wiki locally