Skip to content

Instantly share code, notes, and snippets.

@rakhimoni
Last active December 14, 2015 06:54
Show Gist options
  • Save rakhimoni/6f4e86136e8f7a4c6475 to your computer and use it in GitHub Desktop.
Save rakhimoni/6f4e86136e8f7a4c6475 to your computer and use it in GitHub Desktop.
Android Antivity Indicator
Ti.UI.backgroundColor = 'white';
var win1 = Ti.UI.createWindow({
backgroundColor: 'white',
});
var win2 = Ti.UI.createView({
backgroundColor: 'pink',
height:'300',
width:'300',
});
win1.add(win2);
var activityIndicator = Ti.UI.createActivityIndicator({
color: 'green',
font: {fontFamily:'Helvetica Neue', fontSize:26, fontWeight:'bold'},
message: 'Loading...',
//style: Ti.UI.ActivityIndicatorStyle.DARK,
top:10,
left:10,
height:Ti.UI.SIZE,
width:Ti.UI.SIZE
});
// The activity indicator must be added to a window or view for it to appear
win2.add(activityIndicator);
// eventListeners must always be loaded before the event is likely to fire
// hence, the open() method must be positioned before the window is opened
activityIndicator.show();
win1.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment