Tabs

You must Login before you can answer or comment on any questions.

Hi,

How do I set the current tab to tab 1 and delete tab 0 programatically?

1 Answer

The Kitchen Sink App demos this in the tabgroups bit of the base ui tab....

var win = Titanium.UI.currentWindow;

// get tab group object var tabGroup = win.tabGroup;

tabGroup.setActiveTab(1);

var newtab = tabGroup.tabs[0]; tabGroup.removeTab(newtab);

however I have seen collection mutated whilst enumerating errors doing this - any combination of setActiveTab and removeTab will occasionally result in the error.

I can only assume that the re-draw is doing the enumeration - In fact I have not found a way of removing tabs that does not create an error.

I now create a new tabgroup and close the old one (and trust that the JS / titanium / native stuff deals with GC / memory nicely)

Your Answer

Think you can help? Login to answer this question!