Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked April 23rd 2010 by Steve Gough
  • hide
  • iphone
  • mobile
  • tab
  • tabgroup
0 Comments

2 Answers

  • What i'm doing is :

    win1.hideTabBar();

    in the app.js

    where win1, is your first Titanium.UI.createWindow

    — answered April 24th 2010 by Stephane Pelamourgues
    permalink
    1 Comment
    • Works nicely on the iPhone.. but doesn't work on Android :(

      — commented June 10th 2010 by Matt Collinge
  • 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();
    
    — answered March 12th 2012 by Gaurang Chhatbar
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.