Skip to content

Instantly share code, notes, and snippets.

@rborn
Forked from raulriera/LoadingTableViewRow.js
Created August 20, 2012 14:07
Show Gist options
  • Save rborn/3404579 to your computer and use it in GitHub Desktop.
Save rborn/3404579 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