loading box

You must Login before you can answer or comment on any questions.

Hi,

when I use the createHTTPClient to retrieve information from a third API, it takes a lot of time. How can I display a loading box while it is retrieving the information using titanium?

2 Answers

Accepted Answer

Use Titanium.UI.ActivityIndicator api form displaying a loading box while retrieving data from a third party api.

var win1 = Ti.UI.createWindow({
  backgroundColor: 'blue'
});
var activityIndicator = Ti.UI.createActivityIndicator({
  color: 'green',
  font: {fontFamily:'Helvetica Neue', fontSize:26, fontWeight:'bold'},
  message: 'Loading...',
  style:Ti.UI.iPhone.ActivityIndicatorStyle.DARK,
  top:10,
  left:10,
  height:'auto',
  width:'auto'
});
win1.add(activityIndicator);
Use show() method when request is made on any button click or any window open(whenever request is made) and use hide() method after retrieving data from any third party server.

activityIndicator.show(); activityIndicator.hide();

— answered 8 months ago by Jyoti Gupta
answer permalink
4 Comments
  • so it is better to cut and paste directly from the documentation then to help the user out by directing them to the documentation so they can learn?

    There is no difference between the answer you posted and the link I provided other than NOW with my answer they know how to help themselves and not come back to the QA forums to ask a question that is clearly documented

    — commented 8 months ago by Aaron Saunders

  • i am helping user to solve problem directly rather than going to documentation.He/she should get help.

    — commented 8 months ago by Jyoti Gupta

  • you have simply cut and pasted what is in the documentation.... how is that helping anyone? Now where do they go if they have another question? back to the forum and not the documentation because you just cut and pasted code... anyone can do that, remember the story about teaching a man to fish!!

    — commented 8 months ago by Aaron Saunders

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!