Need help styling a TabNavigator in Flex

I have a tab navigator control and I would like to make all of the tabs a certain color, say blue...

How can this be done?

I have tried through the following CSS:


TabNavigator
{
    tabStyleName: "tabs";
}
.tabs {
    backgroundColor:#6588b9;
}

but it only seems to work with the selected tab...

I then tried to do it programtically:


for(var i:int=0; i<num_of_tabs; i++)
    tn.getTabAt(i).setStyle("backgroundColor","blue");

Yet the same thing happens (only the selected tabs shows the blue background)

What can I do so that all the tabs are blue? Am I going to have to look into skinning?

Thanks.

Answers


I've got a project with styled tabs (I assume you mean the tabs themselves, and not the content). I'm sure there's other ways, but this is what I seem to have ended up with:

.myTabStyle {
    tabStyleName: "myTabs"
}
.myTabs {
    backgroundColor: #ff0000;
    fillColor: #000000;  /* this is the tab widget itself, not the content */
}
<mx:TabNavigator ... styleName="myTabStyle" .. >

There's several places in Flex where you have to use CSS styles to refer to other styles to drill into the widget you want (another example is setting the titlebar style on a TitleWindow).

I hope this helps.

By the way, I've seen occasional "tearing" on Mac & Windows, FireFox, IE, Safari, Flash 9 and 10 with large fonts & colored tabs--I'm not sure if this something I'm doing, something about the larger fonts, or the colored tabs themselves--but just a heads-up. This only happens when building with the Flex 3 SDK (never saw it with Flex 2).


Need Your Help

Problem with the html page on Android

android html emulator

I'm trying to open a html-page in WebView (and in Browser) in 2.2SDK-Emulator, but i get always this message:

how to fetch the objects which has no related (via a specific relationship) entities.

ios cocoa-touch core-data

I want to fetch all the objects from an entity which has no related objects (using a specific key path)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.