Titanium Community Questions & Answer Archive

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

Problem getting the Progressbar in the Navbar

I'm trying to put a progress bar in the navbar. I copied the code, verbatim, from KitchenSink and it just doesn't pop up.

Any ideas? Compiling to 3.1, using Ti SDK 1.3.0.

Here's the code for reference

var ind3=Titanium.UI.createProgressBar({
    width:100,
    min:0,
    max:10,
    value:0,
    color:'#fff',
    message:'Downloading 0 of 10',
    font:{fontSize:14, fontWeight:'bold'},
    style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN
});

win.setTitleControl(ind3);
— asked June 7th 2010 by Alexander Stone
  • navbar
  • progressbar
0 Comments

1 Answer

  • I got it. In case anyone else is having this problem, you have to run the .show() on it after it's been added to the view.

    — answered June 9th 2010 by Alexander Stone
    permalink
    2 Comments
    • Adding to Alex's post:
      This is true for all progress bars, you have to show(). When adding other elements in the navBar you don't have to show().

      — commented June 9th 2010 by Ryan Gartin
    • This is also a classic example of where appcelerators docs are disappointing…
      the coding example shows defining the object, but not applying it (so no reference to show) and the docs advise "This object has no methods" … so somehow we are to magically know about .show() ?

      — commented October 27th 2010 by hayden chambers
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.