Titanium Community Questions & Answer Archive

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

Changing TabBar backgroundColor

Hello,

has anyone had the chance to solve this :

http://support.appcelerator.net/discussions/titanium-mobile-discussion/1606-possible-to-change-main-tabbars-color

it looks like there is a way to do it in objective C

http://silentmac.com/?p=386

thanks a lot

— asked March 27th 2010 by Stephane Pelamourgues
  • bar
  • color
  • tab
  • tabbar
0 Comments

8 Answers

  • Found it… this comes in Ti SDK 3.1.0

    messageBoardTab = Ti.UI.createTab({
          title: '', window: messageBoard,
          icon: '/images/tabBtnCommunity_inactive.png',
          activeIcon: '/images/tabBtnCommunity_active.png',
    });
    
    — answered May 27th 2013 by Joseph Sachs
    permalink
    0 Comments
  • You cannot change the color of the TabBar, but there are tricks to changing the look and feel. For example on all of your windows, you can set win.tabBarHidden = true; and then create you own TabBar that controls the REAL TabBar like this:

    fakeTabGroup.addEventListener('click', function(e) {
        realTabGroup.setActiveTab(e.source.index);
    });
    

    I created a module called Fancy Tabbed Bar that can be styled and used to control the TabBar, you can check it out here.

    — answered January 5th 2012 by David Knell
    permalink
    0 Comments
  • thanks, i tried it but this only changed the navbar and the toolbar (if i set one)

    i'd like to change the tabbed bar as in here :
    http://maverix.typepad.com/.a/6a00d83454dfb769e20120a7163c9d970b-250wi

    which is blue in the above example.

    — answered March 27th 2010 by Stephane Pelamourgues
    permalink
    0 Comments
  • same question…

    — answered August 25th 2011 by Bole Chen
    permalink
    0 Comments
  • Ya how do you change it??

    — answered December 2nd 2011 by Nidhi Shah
    permalink
    0 Comments
  • did you find a solution?

    — answered February 17th 2012 by Kenan Abdullahu
    permalink
    0 Comments
  • Here's what I use on top of my window js file, works but I'm not sure it's not slowering the app…

    
    Ti.UI.currentWindow.barColor = '#b40000';
    
    — answered March 27th 2010 by michel perrin
    permalink
    1 Comment
    • Hi Michael,

      I checked your suggestion. It does not change the color of Tab bar, instead theNavigation bar.

      — commented June 30th 2010 by Radhakrishnan Selvaraj
  • Use 'barImage' or 'barColor' property for Titanium.UI.Window.

    e.g.)

    win2 = Titanium.UI.createWindow({
    title: "Tab 2",
    backgroundColor: "#fff",
    barImage: "button-bar.png"
    });

    OR

    win2.barImage = "button-bar.png";

    — answered July 27th 2012 by Takuma Y
    permalink
    2 Comments
    • this changes the Top Navigation bar. The question refers to the the Botton TabGroup.

      — commented February 4th 2013 by Joseph Sachs
    • sdk 3.1.0 is now possible, here's an example of .tss

      "TabGroup": {
          //tabsBackgroundColor: "#666",
          //activeTabIconTint: "#FOFOFO",
          tabsBackgroundImage:"/tabbar.png",
          activeTabBackgroundImage: "/tabbar-active.png",
          shadowImage: "/navBarShadow.png"
      }
      

      — commented May 2nd 2013 by Nuno Costa
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.