Skip to content

Instantly share code, notes, and snippets.

@raulriera
Created August 20, 2012 13:31
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save raulriera/3404069 to your computer and use it in GitHub Desktop.
Save raulriera/3404069 to your computer and use it in GitHub Desktop.
Loading indicador for tableviews in Titanium Appcelerator
// Just the indicator
var tableView = Titanium.UI.createTableView({
data: [new (require('LoadingTableViewRow').LoadingTableViewRow()]
});
// Or with a message
var tableView = Titanium.UI.createTableView({
data: [new (require('LoadingTableViewRow').LoadingTableViewRow("Loading candy")]
});
LoadingTableViewRow = function(message) {
var row = Titanium.UI.createTableViewRow({
height: 70,
touchEnabled: false
});
var indicator = Titanium.UI.createActivityIndicator({
width:"auto",
height: 30,
color: "665b5b",
message: message,
style: Titanium.UI.iPhone.ActivityIndicatorStyle.DARK
});
// Show the indicator
indicator.show();
// Add it to the row
row.add(indicator);
return row;
};
module.exports = LoadingTableViewRow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment