Opening a different initial tab on tabGroup.open
Hi, quick question on opening a tab group: I have an option dialog on the initial page load to either login or create an account; when you click on either button, it loads a tab group.
What I'd like to do is open that tab group with the second tab showing initially if you click the second button. The following code segments do NOT do this, and I'm not sure what else to try.
Note: I assign tabs to that tabGroupLogin after it, I just removed it for brevity. e.index is the option dialog button the user clicks.
var tabGroupLogin = Ti.UI.createTabGroup();
// always loads the first tab initially
tabGroupLogin.open({
activeTab:e.index
});
// always loads the first tab initially
tabGroupLogin.setActiveTab(e.index).open();
// always loads the first tab initially
tabGroupLogin.open().setActiveTab(e.index);
// also always loads the first tab initially
tabGroupLogin.open();
win.tabGroup.setActiveTab(e.index); // doesn't matter if this goes before or after open()
If anyone has any ideas on how to open a tab group so that a tab other than the first one is shown at first, I'd really appreciate it.
Thanks!
1 Answer
-
Accepted Answer
it's a bug. we have a ticket in lighthouse around this.
https://appcelerator.lighthouseapp.com/projects/32238/tickets/495-setting-active-tab-does-not-work-on-app-startup