Skip to content

Instantly share code, notes, and snippets.

@rakhimoni
Created July 25, 2016 10:35
Show Gist options
  • Select an option

  • Save rakhimoni/3f1dfd9d2080e785e52bdee084bf04d1 to your computer and use it in GitHub Desktop.

Select an option

Save rakhimoni/3f1dfd9d2080e785e52bdee084bf04d1 to your computer and use it in GitHub Desktop.
Click event on tabgroup
Test code:
////////////////////////////
var win1 = Ti.UI.createWindow({
backgroundColor: 'blue',
title: 'Blue'
});
win1.add(Ti.UI.createLabel({text: 'I am a blue window.'}));
var win2 = Ti.UI.createWindow({
backgroundColor: 'red',
title: 'Red'
});
win2.add(Ti.UI.createLabel({text: 'I am a red window.'}));
var tab1 = Ti.UI.createTab({
window: win1,
title: 'Blue'
}),
tab2 = Ti.UI.createTab({
window: win2,
title: 'Red'
}),
tabGroup = Ti.UI.createTabGroup({
tabs: [tab1, tab2]
});
tab2.addEventListener('click', function(e) {
alert('You clicked tab 2'); });
tabGroup.open();
/////////////////////////////////////////
Click here to see output: https://i.imgsafe.org/5eb663aaeb.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment