views:

25

answers:

1

Is there a way to set a common Backgroundcolor for all the tabs in a given TabBar?

Rightnow I am able to set color only for selected tabs using

tabBar.getChildAt and setStyle

+1  A: 

Give them all a common styleName and set the backgroundColor style in CSS.

MXML

<mx:TabNavigator width="100%" height="100%">
    <mx:VBox label="Tab 1" styleName="tabContainers"></mx:VBox>
    <mx:VBox label="Tab 2" styleName="tabContainers"></mx:VBox>
    <mx:VBox label="Tab 2" styleName="tabContainers"></mx:VBox>
</mx:TabNavigator>

CSS:

.tabContainers
{
    backgroundColor: #ff0000;
}
joshtynjala