Hide Tabs
What's the proper usage for hiding tabs? I'm trying something like this
//
// add tabs
//
tabGroup.addTab(tab0);
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
// open tab group
tabGroup.open();
//
// TAB EVENTS
//
tabGroup.addEventListener('open', function(e)
{
tabGroup.tabs[1].hide();
tabGroup.tabs[2].hide();
});
The hide() method is having no appreciable effect however since tab1 and tab2 are still visible in the tabgroup when tab0 is active. Also is it possible to hide a tab even if it's the currently selected one?
2 Answers
-
What i'm doing is :
win1.hideTabBar();
in the app.js
where win1, is your first Titanium.UI.createWindow
-
Hi Steve,
this is trick to hide tabbar in android, I tested in 1.8.0.1 SDK but it is not working in 1.8.2 for me.
var win1 = Titanium.UI.createWindow({ title : 'Tab 1', url : 'test.js', tabBarHidden : true, tabgroup : tabGroup }); win1.addEventListener('open', function(ev) { setTimeout(function(e) { tabGroup.animate({ top : -95, duration : 0 }); }, 200); alert("Successfull"); }); var tab1 = Titanium.UI.createTab({ icon : 'KS_nav_views.png', title : 'Tab 1', window : win1 }); // add tabs // tabGroup.addTab(tab1); // open tab group tabGroup.open();