Hi guys, today I want to show how to control the status bar (the top most bar on the iOS devices with the carrier logo/time/battery life on it).  It is always shown by default unless you specifically tell your app not to show it.  Also, the colour of the status bar can be controlled too.

To hide the status bar:

Titanium.UI.iPhone.hideStatusBar();

To show the status bar:

Titanium.UI.iPhone.showStatusBar();

You can change the colour of the status bar to one of following four:

  • Opaque black
  • Gray
  • Translucent blank
  • Default
// Change to opaque black
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK

// Change to gray
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.GRAY;

// Change to translucent 
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.TRANSLUCENT_BLACK;

// Use the default
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.DEFAULT;

#UPDATE – Thanks to Luke Peek
You can also edit the tiapp.xml file, for example an app with an opaque black status bar in the tiapp would be:

<statusbar-style>opaque</statusbar-style>