Titanium Community Questions & Answer Archive

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

How can unselect tab.

Hello,

 I am using two tabbed bars tb1 and tb2 I want to 
  unselected tb1 when tb2 is selected. how it is possible.

// title control
var tb1 = Titanium.UI.createTabbedBar({
index:0,
labels:['Home','Log in','Upload video'],
backgroundColor:'#333333',
style:Titanium.UI.iPhone.SystemButtonStyle.BAR
});
win1.setTitleControl(tb1);

var tb2 = Titanium.UI.createTabbedBar({
labels:['Search','Most viewed','Most recent'],
backgroundColor:'#333333',
style:Titanium.UI.iPhone.SystemButtonStyle.BAR
});
var flexSpace = Titanium.UI.createButton({
systemButton:Titanium.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});

win1.setToolbar([flexSpace,tb2,flexSpace]);

— asked March 27th 2010 by vikas khairnar
  • tabbedbar
0 Comments

2 Answers

  • Hi vikas,

    I could be wrong but I think a tabbed bar always has one button selected. You could try using a 'toolbar' but would probably have to manage the states in your code.

    cheers,
    Chris.

    — answered March 27th 2010 by Chris Reed
    permalink
    0 Comments
  • Set the index of TabbedBar to -1 to deselect

    — answered September 11th 2013 by Latheesan Kanesamoorthy
    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.