Created
August 20, 2012 13:31
-
-
Save raulriera/3404069 to your computer and use it in GitHub Desktop.
Loading indicador for tableviews in Titanium Appcelerator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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")] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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