Switch between Tabs #13621
Answered
by
m1ga
beppo-ivel
asked this question in
Q&A
Switch between Tabs
#13621
-
I have open a TabGroup containing 3 Tabs. Each of them represents his own view and controller (Alloy framework). If I want to switch between the Tabs do I have to call |
Beta Was this translation helpful? Give feedback.
Answered by
m1ga
Oct 27, 2022
Replies: 1 comment 4 replies
-
var win1 = Ti.UI.createWindow({
backgroundColor: 'blue',
title: 'Blue'
});
win1.add(Ti.UI.createLabel({text: 'click to go to tab 2'}));
win1.addEventListener("click",function(){
tabGroup.activeTab = 1
})
var win2 = Ti.UI.createWindow({
backgroundColor: 'red',
title: 'Red'
});
win2.add(Ti.UI.createLabel({text: 'click to go to tab 1'}));
win2.addEventListener("click",function(){
tabGroup.activeTab = 0
})
var tab1 = Ti.UI.createTab({
window: win1,
title: 'Blue'
}),
tab2 = Ti.UI.createTab({
window: win2,
title: 'Red'
}),
tabGroup = Ti.UI.createTabGroup({
tabs: [tab1, tab2]
});
tabGroup.open(); |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
beppo-ivel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tabgroup.activeTab = 1
(https://titaniumsdk.com/api/titanium/ui/tabgroup.html#activetab)