Created
July 25, 2016 10:35
-
-
Save rakhimoni/3f1dfd9d2080e785e52bdee084bf04d1 to your computer and use it in GitHub Desktop.
Click event on tabgroup
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
| 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