Skip to content

Switch between Tabs #13621

Answered by m1ga
beppo-ivel asked this question in Q&A
Oct 27, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

tabgroup.activeTab = 1 (https://titaniumsdk.com/api/titanium/ui/tabgroup.html#activetab)

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, t…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@beppo-ivel
Comment options

@m1ga
Comment options

m1ga Oct 27, 2022
Collaborator

@beppo-ivel
Comment options

@m1ga
Comment options

m1ga Oct 27, 2022
Collaborator

Answer selected by beppo-ivel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants