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();
Your Answer
Think you can help? Login to answer this question!