Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

<statusbar-style> node

I've the following tiapp.xml:

<?xml version="1.0" encoding="UTF-8"?>
<ti:app xmlns:ti="http://ti.appcelerator.org">
<id>appleid</id>
<name>Example</name>
<version>1.0</version>
<publisher>glopes</publisher>
<url>http://www</url>
<description>Test examples</description>
<copyright>2010 by glopes</copyright>
<icon>default_app_logo.png</icon>
    <persistent-wifi>false</persistent-wifi>
    <prerendered-icon>false</prerendered-icon>
    <statusbar-style>opaque_black</statusbar-style>
    <statusbar-hidden>false</statusbar-hidden>
    <fullscreen>false</fullscreen>
    <navbar-hidden>false</navbar-hidden>
    <guid>6a3e5230-92df-461e-9dc4-8cdfb2128a17</guid>
</ti:app>

I want to change the style of statusBar from default to opaque_black and i thought that node called statusbar-style was enough to do that. But it not works, someone have any idea how can i do that??

Im using titanium sdk 1.3.0 and iphone sdk 3.1.3

Regards,
Gilliard Alan.

— asked June 14th 2010 by Gilliard Lopes
  • iphone
  • statusbar-style
  • tiapp.xml
0 Comments

4 Answers

  • in your tiapp.xml change this:

    <statusbar-style>default</statusbar-style>

    to this:

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

    and you'll get the black statusbar. I can't believe how long it took me to find this. I hope it helps someone else. Appcelerator should really post this somewhere.

    — answered November 11th 2010 by Glen McPherson
    permalink
    3 Comments
    • Using opaque worked perfectly. Trying to use Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK didn't work in tiapp.xml

      — commented October 12th 2011 by Harry Park
    • thanks

      — commented March 19th 2012 by Ding Hua
    • thanks much!

      — commented July 16th 2012 by Mickey Asavanant
  • Try this

    Titanium.UI.iPhone.setStatusBarStyle(Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK);
    

    I'm not sure but you might need to set this for each window you have in your app.

    — answered June 15th 2010 by Dan Tamas
    permalink
    1 Comment
    • I put this in my app.js file and it changes when the splash screen loads. I also have it set in my xml file.

      <statusbar-style>OPAQUE_BLACK</statusbar-style>

      — commented November 11th 2010 by Jeffrey Messick
  • actually you do the right thing. But since the tiapp.xml is not copied into the build dir you can't see any effects. Delete the iPhone Build dir and recompile.

    :)
    Stefan

    — answered June 12th 2011 by Stefan Klefisch
    permalink
    0 Comments
  • Hello Daniel, i tried it before and, in fact, the statusBar changed to black and you not need to set this for each window, it's affect all windows.

    But the problem is on the inicialization because the splash screen has statusBar color = gray (default). After the splash screen is showed, this command (setStatusBarStyle) is called and the statusBar color's is changed.
    You can see the statusBar changing it's color from gray to black and it causes a "blink" effect.

    if someone knows how can i adjust it…

    Thanks for your support.

    — answered June 15th 2010 by Gilliard Lopes
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.