Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Multiple independent counters in one window.
var win = Ti.UI.createWindow({backgroundColor:'white'});
var counters = [0,0,0];
counters.forEach(function(count,i){
var label = Ti.UI.createLabel({text:'Counter ' + (i+1) + ': 0', top:50+i*100, font:{fontSize:20}});
var inc = Ti.UI.createButton({title:'+', top:80+i*100, left:50});
var dec = Ti.UI.createButton({title:'-', top:80+i*100, left:120});
inc.addEventListener('click', function(){
counters[i]++;
label.text = 'Counter ' + (i+1) + ': ' + counters[i];
});
dec.addEventListener('click', function(){
counters[i]--;
label.text = 'Counter ' + (i+1) + ': ' + counters[i];
});
win.add(label);
win.add(inc);
win.add(dec);
});
win.open();Titanium Appcelerator is an open-source mobile development framework that allows developers to build native iOS and Android apps using JavaScript, providing a single codebase for multiple platforms.
Origin & Creator
Created by Appcelerator, Inc. in 2008 to simplify cross-platform native mobile development using JavaScript.
Industrial Note
Titanium is widely used in enterprise mobile applications where native performance and device API access are required, particularly in banking, healthcare, and logistics apps.