Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DynamicLabel tag in Alloy - allows you to update a "value" and it applies it to a template. Place ui.js in your app/lib folder
$.recordCount.value = 99
<View class="container">
<DynamicLabel module="ui" id="recordCount" value="0" template="? Records"/>
exports.createDynamicLabel = function(args) {
var label = Ti.UI.createLabel(args);
function updateText() {
label.text = label.template.replace("?", label.value);
label.getValue = function() {
return label.value;
label.setValue = function(value) {
label.value = value;
return label;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment