Created
December 23, 2011 12:04
-
-
Save hal-gh/1513998 to your computer and use it in GitHub Desktop.
Tab test
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
Ti.UI.setBackgroundColor('#000'); | |
var tabGroup = Ti.UI.createTabGroup(); | |
var win1 = Ti.UI.createWindow({ | |
title:'Tab 1', | |
backgroundColor:'#fff' | |
}); | |
var tab1 = Ti.UI.createTab({ | |
title:'Tab 1', | |
window:win1 | |
}); | |
var label1 = Ti.UI.createLabel({ | |
color:'#999', | |
text:'I am Window 1', | |
textAlign:'center', | |
width:'auto' | |
}); | |
win1.add(label1); | |
var win2 = Ti.UI.createWindow({ | |
title:'Tab 2', | |
backgroundColor:'#fff' | |
}); | |
var tab2 = Ti.UI.createTab({ | |
title:'Tab 2', | |
window:win2 | |
}); | |
var label2 = Ti.UI.createLabel({ | |
color:'#999', | |
text:'I am Window 2', | |
textAlign:'center', | |
width:'auto' | |
}); | |
win2.add(label2); | |
tabGroup.addTab(tab1); | |
tabGroup.addTab(tab2); | |
tabGroup.open(); | |
tab1.addEventListener('click', function(e) { | |
Ti.API.info("tab1 clicked."); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment