tags:

views:

38

answers:

2

I have a theme in my app that defines a custom color for the background. This is the green you see above the tabwidget.

In some of my Activities I'm using a Tabhost for my Layout. Now I get something like this as a result:

alt text

My tabwidget has a black background and I'm happy with that, but the icons in the tabwidget are transparent and this leads to them showing the green background defined in my style.

How can I define the tabhost as not styled and have the transparent icons show the tabwidget the resion on instead of a solid background color?

A: 

Do you really want to remove all styles, or just the background? If you just need to change the background, edit the TabHost elements in your layout xml files to set the background.

    <TabHost
        ...
        android:background="@color/mytabhostbackround"
        ...>
            ...
    </TabHost>

Alternatively, you could set the style attribute of the TabHost, or even set a different Theme for the activity.

I edited my question, the background for the tabhost/widget is set but the icons on top of the tabselector things are showing the background defined in my style.
Janusz
+1  A: 

I found a solution to my problem.

I changed my style from

  <item name="android:background">@color/light_green</item>
</style>

to:

  <item name="android:windowBackground">@color/light_green</item>
</style>

This causes the window to have the correct background but it won't override all the backgrounds in undefined views.

Janusz