Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created December 14, 2011 13:34
Show Gist options
  • Save bytespider/1476580 to your computer and use it in GitHub Desktop.
Save bytespider/1476580 to your computer and use it in GitHub Desktop.
var tabGroup = Ti.UI.createTabGroup();
var tabsArray = tabGroup.tabs;
Object.defineProperty(
tabGroup,
"tabs",
{
get: function () {
alert(tabGroup.tabs.length + " tabs");
return tabsArray;
},
set: function (tabs) {
tabsArray = tabs;
}
}
);
// or even
tabGroup.addTab = function (tab) {
tab.icon = ""; // do funky things with our tab
Ti.UI.TabGroup.prototype.addTab.call(tabGroup, tab);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment