Skip to content

Instantly share code, notes, and snippets.

@sevir
Created March 8, 2011 12:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sevir/860220 to your computer and use it in GitHub Desktop.
Save sevir/860220 to your computer and use it in GitHub Desktop.
Progress window in Titanium cross mobile
function showIndicator()
{
// window container
indWin = Titanium.UI.createWindow({
height:150,
width:150
});
// black view
var indView = Titanium.UI.createView({
height:150,
width:150,
backgroundColor:'#000',
borderRadius:10,
opacity:0.8
});
indWin.add(indView);
// loading indicator
actInd = Titanium.UI.createActivityIndicator({
style:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG,
height:30,
width:30
});
indWin.add(actInd);
// message
var message = Titanium.UI.createLabel({
text:'Loading',
color:'#fff',
width:'auto',
height:'auto',
font:{fontSize:20,fontWeight:'bold'},
bottom:20
});
indWin.add(message);
indWin.open();
actInd.show();
}
function hideIndicator()
{
actInd.hide();
indWin.close({opacity:0,duration:500});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment