Titanium Community Questions & Answer Archive

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

How to add a simple

Alright, this seems like the simplest thing but I can't quite seem how to get it to work…

How do you add a simple "Loading" text label as your App content loads? Like on the first page I have a TableView with rows pulled from a MySQL DB and they take like ~5 seconds to load (Depending on 3G, WiFi, etc.). Right now it just shows a blank screen, then everythig loads. How would I add a "Loading…" with maybe an activity indicator under it that will show up just when the content is loading?

— asked September 10th 2010 by Colton Arabsky
  • loading
  • tableview
0 Comments

5 Answers

  • Like this?
    http://github.com/appcelerator/titanium_mobile/blob/master/demos/KitchenSink/Resources/examples/activity_indicator.js

    Show the activity indicator when your app starts and after you set the data for the table hide it.

    — answered September 10th 2010 by Dan Tamas
    permalink
    0 Comments
  • Yes, but I don't really understand how to get it to show before it loads.

    — answered September 10th 2010 by Colton Arabsky
    permalink
    0 Comments
  • First of all, keep in mind that you can't add an activity (loading) indicator to your Default.png that first shows when you launch your app. That's just a static image.

    Once your app actually loads, the first thing you should do is show an activity indicator. Create it and add it to your window. Then add an event listener or flag of some kind to your database operations so that when it's done loading, you can hide the loading indicator. There's a lot to do to pull that off, but hopefully that gets you pointed in the right direction.

    — answered September 10th 2010 by Clifton Labrum
    permalink
    0 Comments
  • The activity indicator cannot be shown before the splash screen, but only after it.
    So in you app.js, first thing to do is to create the activityIndicator and show it ( using the it's method show ).

    — answered September 10th 2010 by Dan Tamas
    permalink
    0 Comments
  • For some reason the simulator can't view the ActivityIndicator, it gives me an error. I can't get you the error now, I'll get it in an hour or so.

    — answered September 10th 2010 by Colton Arabsky
    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.