Android - tabhost not change background color - android

I already setup my tabhost background colour but it's not working.
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle</item>
</style>
<style name="ActionBarTabStyle"
parent="#style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">#drawable/tab_bg_selector</item>
<item name="background">#drawable/tab_bg_selector</item>
</style>
tab_bg_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#color/blueLight" android:state_pressed="true"/>
<item android:drawable="#color/blueLight" android:state_selected="true"/>
<item android:drawable="#color/blueDark"/>
</selector>
bottom_tabs.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="#+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<android.support.v4.app.FragmentTabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
</android.support.v4.app.FragmentTabHost>
</LinearLayout>

Since you are using AppCompat library, use this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle</item>
</style>
<style name="ActionBarTabStyle"
parent="#style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">#drawable/tab_bg_selector</item>
<item name="background">#drawable/tab_bg_selector</item>
</style>
You needed the Widget.AppCompat.ActionBar.TabView parent and the android: variants for AppCompat support.
That is according to ActionBar's documentation and ActionBar Tab's documentation.

If you are OK to change color in code than you can try this:
tabHost.setOnTabChangedListener(new OnTabChangeListener() {
public void onTabChanged(String arg0) {
for (int i = 0; i < tab.getTabWidget().getChildCount(); i++) {
tab.getTabWidget().getChildAt(i)
.setBackgroundResource(R.drawable.tab_selected); // unselected
}
tab.getTabWidget().getChildAt(tab.getCurrentTab())
.setBackgroundResource(R.drawable.tab_unselected); // selected
}
});

You can try it:
tab_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:drawable="#drawable/unselected_tab" android:state_focused="false" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="#drawable/button_buynow" android:state_focused="false" android:state_pressed="false" android:state_selected="true"/>
<!-- Focused states -->
<item android:drawable="#drawable/unselected_tab" android:state_focused="true" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="#drawable/selected_tab" android:state_focused="true" android:state_pressed="false" android:state_selected="true"/>
<!-- Pressed -->
<!-- Non focused states -->
<item android:drawable="#drawable/unselected_tab" android:state_focused="false" android:state_pressed="true" android:state_selected="false"/>
<item android:drawable="#drawable/button_buynow" android:state_focused="false" android:state_pressed="true" android:state_selected="true"/>
<!-- Focused states -->
<item android:drawable="#drawable/unselected_tab" android:state_focused="true" android:state_pressed="true" android:state_selected="false"/>
<item android:drawable="#drawable/button_buynow" android:state_focused="true" android:state_pressed="true" android:state_selected="true"/>
</selector>
After declaration in you MainActivity, you can use following code:
TabWidget widget = th.getTabWidget();
for (int i = 0; i < widget.getChildCount(); i++) {
View v = widget.getChildAt(i);
v.setBackgroundResource(R.drawable.tab_selector);
}

In your theme, add the following
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
Then add MyActionBar style (replace drawable entries with your own):
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<!-- action bar background -->
<item name="background">#drawable/ab_solid_mytabhost</item>
<!-- needed for 'stacked' & 'split' action bar (used by tabhost) -->
<item name="backgroundStacked">#drawable/ab_stacked_solid_mytabhost</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_mytabhost</item>
</style>
Your styles.xml should look something like this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarTabStyle">#style/ActionBarTabStyle</item>
<item name="actionBarTabStyle">#style/ActionBarTabStyle</item>
</style>
<style name="ActionBarTabStyle" parent="#style/Widget.AppCompat.ActionBar.TabView">
<item name="android:background">#drawable/tab_bg_selector</item>
<item name="background">#drawable/tab_bg_selector</item>
<!-- add these -->
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="actionBarStyle">#style/MyActionBar</item>
</style>
<!-- add this-->
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<!-- action bar background -->
<item name="background">#drawable/ab_solid_mytabhost</item>
<!-- needed for 'stacked' & 'split' action bar (used by tabhost) -->
<item name="backgroundStacked">#drawable/ab_stacked_solid_mytabhost</item>
<item name="backgroundSplit">#drawable/ab_bottom_solid_mytabhost</item>
</style>
For a working sample, here's a link to a sample project: https://github.com/ebernie/MyTabHostThemeSample

Related

How to change selected tab Color or Font color for ActionbarTab?

I am using xml to change background of selected tab using Actionbar Tab with view pager
code is below,
style.xml
<!-- Custom theme. -->
<style name="MyTheme" parent="android:style/Theme.Holo.Light">
<item name="android:windowActionBar">true</item>
<item name="android:actionBarSize">30dp</item>
<item name="android:icon">#drawable/logo</item>
<item name="android:actionBarTabTextStyle">#style/Widget.Holo.TabWidget</item>
<!-- <item name="android:actionBarTabTextStyle">#style/customTabBar</item> -->
</style>
<style name="Widget.Holo.TabWidget" parent="android:style/Widget.TabWidget">
<item name="android:tabStripLeft">#null</item>
<item name="android:tabStripRight">#null</item>
<item name="android:tabStripEnabled">true</item>
<!-- <item name="android:divider">#android:attr/dividerVertical</item> -->
<item name="android:showDividers">middle</item>
<item name="android:dividerPadding">8dip</item>
<item name="android:divider">#android:attr/dividerVertical</item>
<item name="android:dividerHeight">10dp</item>
<item name="android:measureWithLargestChild">true</item>
<item name="android:textSize">16sp</item>
<item name="android:textStyle">bold</item>
<item name="android:background">#drawable/tab_bg_selector</item>
</style>
tab_bg_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Active tab -->
<item android:drawable="#drawable/tab_bg_selected" android:state_focused="false" android:state_pressed="false" android:state_selected="true"/>
<!-- Inactive tab
<item android:drawable="#drawable/tab_bg_unselected" android:state_focused="false" android:state_pressed="false" android:state_selected="false"/>
-->
<item android:drawable="#android:color/transparent" android:state_pressed="true"/>
<!-- Selected tab (using d-pad) -->
<item android:drawable="#android:color/transparent" android:state_focused="true" android:state_pressed="false" android:state_selected="true"/>
tab_bg_selected.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient
android:centerColor="#7F7F7F"
android:endColor="#696969"
android:startColor="#A8A8A8" />
</shape>
It shows me changed color but color is changes for text background only I want to change for whole Tab selected
See below image,
These custom styles work fine for me
<style name="MyActionBarTabStyle" parent="#style/Widget.AppCompat.Light.ActionBar.TabView">
<item name="android:tabStripEnabled">false</item>
<item name="android:footerDividersEnabled">false</item>
<item name="android:background">#drawable/tab_selector</item>
<item name="background">#drawable/tab_selector</item>
</style>
And
<style name="MyActionBarTabTextStyle" parent="#style/Widget.AppCompat.Light.ActionBar.TabText">
<item name="android:textColor">#color/tab_text_color</item>
<item name="android:textSize">12sp</item>
<item name="android:gravity">fill_horizontal</item>
</style>
I hope it works fine for u as well
Take a look to this: Styling Tabs

Change IndicatorColor of default tab

I need to change the color of the indicator of the tab but I didn't manage to do this.
Do anyone know how to do?
This is my stiles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:actionBarTabTextStyle">#style/MyCustomTabView</item>
<item name="android:ratingBarStyleIndicator">#style/indicator_color</item>
<item name="android:actionBarTabStyle">#style/CustomActionBarTheme</item>
</style>
<style name="MyCustomTabView" parent="Theme.AppCompat.Light">
<item name="android:actionBarItemBackground">#style/indicator_color</item>
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">12dp</item>
<item name="android:textStyle">bold</item>
<item name="android:backgroundStacked">#ffffff</item>
</style>
<style name="indicator_color">
<item name="android:background">#ffffff</item>
</style>
<style name="CustomActionBarTheme"
parent="Theme.">
<item name="android:actionBarTabStyle">#style/MyActionBarTabs</item>
</style>
<!-- ActionBar tabs styles -->
<style name="MyActionBarTabs"
parent="Theme.AppCompat.Light">
<!-- tab indicator -->
<item name="android:background">#drawable/actionbar_tab_indicator</item>
</style>
and this is actionbar_tab_indicator.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- STATES WHEN BUTTON IS NOT PRESSED -->
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false"
android:state_pressed="false"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<item android:state_focused="false" android:state_selected="true"
android:state_pressed="false"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<!-- Focused states (such as when focused with a d-pad or mouse hover) -->
<item android:state_focused="true" android:state_selected="false"
android:state_pressed="false"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<item android:state_focused="true" android:state_selected="true"
android:state_pressed="false"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<!-- STATES WHEN BUTTON IS PRESSED -->
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false"
android:state_pressed="true"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<item android:state_focused="false" android:state_selected="true"
android:state_pressed="true"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<!-- Focused states (such as when focused with a d-pad or mouse hover) -->
<item android:state_focused="true" android:state_selected="false"
android:state_pressed="true"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
<item android:state_focused="true" android:state_selected="true"
android:state_pressed="true"
android:drawable="#drawable/abc_ab_bottom_solid_light_holo" />
</selector>
Thanks in advance.
To change the indicator used for the navigation tabs, create an activity theme that overrides the actionBarTabStyle property. This property points to another style resource in which you override the background property that should specify a state-list drawable.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
parent="#style/Theme.Holo">
<item name="android:actionBarTabStyle">#style/MyActionBarTabs</item>
</style>
<!-- ActionBar tabs styles -->
<style name="MyActionBarTabs"
parent="#style/Widget.Holo.ActionBar.TabView">
<!-- tab indicator -->
<item name="android:background">#drawable/actionbar_tab_indicator</item>
</style>
</resources>
Read more here.
You can change background of TabWidget(this is possibly what you are saying) like this:
If this is your style:
<style name="indicator_color">
<item name="android:background">#android:color/black</item>
</style>
Use it like this:
<TabWidget
style="#style/indicator_color"
android:id="#android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</TabWidget>
Also note that #ffffff is white color. So you may not see the effect.

Custom theme ActionBar android (menu not working)

I want to to customize my app and i've applied a theme but the options menu doesn't seem to apply my theme.
I want my text color to be white, my background to be black and the highlighted/selected menu item to be yellow.
Here is my theme.xml:
<style name="CustomActionBarTheme" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<item name="android:actionBarTabTextStyle">#style/MyActionBarTabText</item>
<item name="android:actionMenuTextColor">#color/application_color5</item>
<item name="android:actionBarTabStyle">#style/MyActionBarTabs</item>
<item name="android:selectableItemBackground">#drawable/icone_barratopo_selector</item>
<item name="android:actionBarItemBackground">#drawable/icone_barratopo_selector</item>
<item name="android:selectableItemBackground">#drawable/icone_barratopo_selector</item>
<!-- Panel attributes -->
<!-- <item name="android:panelBackground">#drawable/selectable_background</item> --
<!-- Support library compatibility -->
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="actionBarTabTextStyle">#style/MyActionBarTabText</item>
<item name="actionMenuTextColor">#color/application_color5</item>
<item name="actionBarTabStyle">#style/MyActionBarTabs</item>
<item name="selectableItemBackground">#drawable/icone_barratopo_selector</item>
<item name="actionBarItemBackground">#drawable/icone_barratopo_selector</item>
<item name="selectableItemBackground">#drawable/icone_barratopo_selector</item>
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="#style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">#drawable/background_barratopo_superior</item>
<item name="android:titleTextStyle">#style/MyActionBarTitleText</item>
<!-- Support library compatibility -->
<item name="background">#drawable/background_barratopo_superior</item>
<item name="titleTextStyle">#style/MyActionBarTitleText</item>
</style>
<!-- ActionBar title text -->
<style name="MyActionBarTitleText" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/application_color2</item>
</style>
<!-- ActionBar tabs text -->
<style name="MyActionBarTabText" parent="#style/Widget.AppCompat.ActionBar.TabText">
<item name="android:textColor">#drawable/tab_text_selector</item>
</style>
<!-- ActionBar tabs styles -->
<style name="MyActionBarTabs" parent="#style/Widget.AppCompat.ActionBar.TabView">
<!-- tab indicator -->
<item name="android:background">#drawable/actionbar_tab_indicator</item>
<!-- Support library compatibility -->
<item name="background">#drawable/actionbar_tab_indicator</item>
</style>
My menu.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:motobox="http://schemas.android.com/apk/res-auto" >
<!--
<item
android:id="#+id/option_availability"
android:icon="#drawable/icone_barratopo_mymotobox"
android:orderInCategory="100"
motobox:showAsAction="always"/>
-->
<item
android:id="#+id/option_refresh"
android:icon="#drawable/icone_barratopo_back"
android:orderInCategory="100"
motobox:showAsAction="always"/>
<item
android:id="#+id/status"
android:orderInCategory="100"
android:title="Indisponível"
motobox:showAsAction="never"/>
<item
android:id="#+id/logout"
android:orderInCategory="100"
android:title="Logout"
motobox:showAsAction="never"/>
and my selector.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="#color/application_color3" android:state_focused="false" android:state_pressed="false" android:state_selected="false"/>
<!-- Pressed -->
<item android:drawable="#color/application_color2" android:state_pressed="true"/>
<!-- Focused -->
<item android:drawable="#color/application_color2" android:state_focused="true" android:state_pressed="false" android:state_selected="false"/>
Rename your file from theme.xml to
res/values/themes.xml
And remember you can apply your theme to your entire app
<application android:theme="#style/myCustomTheme">
or individual activities
<activity android:theme="#android:style/myCustomTheme">
Edit the line:
<item name="background">#drawable/actionbar_tab_indicator</item>
to
<item name="android:background">#drawable/actionbar_tab_indicator</item>
:)

How to change the color of tab 'underbar' in actionbarsherlock

Ok i'm loosing more sanity then ever. I can't find/understand how to style the damn thing.
I managed to change the background of the tab itself but I can't cahnge the color of the bar under the selected tab.
How to change it from blue to something.
My styles.xml unfortunately I have very bad understanding of how it works
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Styled" parent="Theme.Sherlock.Light">
<item name="actionBarTabStyle">#style/Widget.Styled.ActionBarTab</item>
<item name="android:actionBarTabStyle">#style/Widget.Styled.ActionBarTab</item>
<item name="actionBarTabBarStyle">#style/Widget.Styled.ActionBarTabBar</item>
<item name="android:actionBarTabBarStyle">#style/Widget.Styled.ActionBarTabBar</item>
<item name="actionBarTabTextStyle">#style/myText</item>
<item name="android:actionBarTabTextStyle">#style/myText</item>
</style>
<style name="Widget.Styled.ActionBarTab" parent="Widget.Sherlock.Light.ActionBar.TabView">
<!-- <item name="background">#drawable/startbcg</item>
<item name="android:background">#drawable/startbcg</item>
<item name="backgroundSplit">#drawable/bg_striped_split</item>
<item name="android:backgroundSplit">#drawable/bg_striped_split</item>
-->
</style>
<style name="Widget.Styled.ActionBarTabBar" parent="Widget.Sherlock.Light.ActionBar.TabBar">
<item name="background">#drawable/startbcg</item>
<item name="android:background">#drawable/startbcg</item>
<item name="backgroundSplit">#drawable/bg_striped_split</item>
<item name="android:backgroundSplit">#drawable/bg_striped_split</item>
</style>
<style name="myText" parent="Widget.Sherlock.Light.ActionBar.TabText">
<item name="android:textAppearance">#android:style/TextAppearance.Medium</item>
<item name="android:textColor">#android:color/primary_text_dark</item>
<item name="android:textSize">10sp</item>
</style>
<style name="myTextInv" parent="Widget.Sherlock.Light.ActionBar.TabText.Inverse">
<item name="android:textAppearance">#android:style/TextAppearance.Medium</item>
<item name="android:textColor">#android:color/primary_text_dark</item>
<item name="android:textSize">10sp</item>
</style>
</resources>
Bonus question: where I can find what properties (like background) certain stuff has.
Use ActionbarStyleGenerator to style the Actionbar. This is by far the simplest and most intuitive way.
How to:
Use the UI to select colors for different items
Once done click on "DOWNLOAD .ZIP"
The ZIP file contains resource files that you have to copy in your project res/layout and
res/drawableXXXX folders
I found that for the background it's better to copy the drawables (9 patches and xml) found on the Android SDK res directory and change it to have the color you like.
They use a background with the bottom bar included, so I don't think it's possible to change the bottom bar alone.
Here's what I have, working with green color for the bottom bar:
<style name="customTabStyle" parent="Widget.Sherlock.ActionBar.TabView">
<item name="android:showDividers">none</item>
<item name="android:measureWithLargestChild">true</item>
<!-- This was a copy from the sdk drawable -->
<item name="android:background">#drawable/tab_indicator</item>
<item name="background">#drawable/tab_indicator</item>
<item name="android:gravity">center</item>
<item name="android:textStyle">normal</item>
</style>
<style name="customTabBar" parent="Widget.Sherlock.ActionBar.TabBar">
<item name="android:showDividers">middle</item>
<item name="android:divider">#drawable/tab_divider</item>
<item name="divider">#drawable/tab_divider</item>
<item name="android:dividerPadding">10dip</item>
<item name="android:background">#drawable/tab_bg</item>
</style>
The tab indicator looks like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="#drawable/tab_unselected" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="#drawable/tab_selected" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="#drawable/tab_unselected_focused" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="#drawable/tab_selected_focused" />
<!-- Pressed -->
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="#drawable/tab_unselected_pressed" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="true" android:drawable="#drawable/tab_selected_pressed" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="#drawable/tab_unselected_pressed" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="true" android:drawable="#drawable/tab_selected_pressed" />
</selector>
I hope it helps!

Android - ActionBarSherlock - Set textcolor of text in submenu

How can i set the color of text in submenu of Action Bar Sherlock ? I can set the background but not the textcolor.. =(
temas.xml
<style name="Tema.Laranja" parent="Theme.Sherlock.Light.ForceOverflow">
<item name="actionBarItemBackground">#drawable/background_selecionado</item>
<item name="android:actionBarItemBackground">#drawable/background_selecionado</item>
<item name="android:dropDownListViewStyle">#style/Tema.Laranja.ListSelector</item>
<item name="dropDownListViewStyle">#style/Tema.Laranja.ListSelector</item>
<item name="popupMenuStyle">#style/Tema.Laranja.Popup</item>
<item name="android:popupMenuStyle">#style/Tema.Laranja.Popup</item>
</style>
<style name="Tema.Laranja.Popup" parent="Widget.Sherlock.Light.PopupMenu">
<item name="android:popupBackground">#drawable/shape_laranja_arredondado</item>
</style>
<style name="Tema.Laranja.ListSelector" parent="Widget.Sherlock.ListView.DropDown">
<item name="android:listSelector">#color/listview_actionbar</item>
<item name="android:textColor">#color/branca</item>
<item name="android:drawSelectorOnTop">true</item>
</style>
My listview_actionbar.xml
<item android:state_focused="false"
android:drawable="#drawable/shape_amarelo_arredondado"/>
<!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. -->
<item android:state_focused="true" android:state_enabled="false"
android:state_pressed="true"
android:drawable="#drawable/shape_amarelo_arredondado" />
<item android:state_focused="true" android:state_enabled="false"
android:drawable="#drawable/shape_amarelo_arredondado" />
<item android:state_focused="true" android:state_pressed="true"
android:drawable="#drawable/shape_amarelo_arredondado" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="#drawable/shape_amarelo_arredondado" />
<item android:state_focused="true"
android:drawable="#drawable/shape_amarelo_arredondado" />
<style name="MyPopupMenu" parent="Widget.Sherlock.ListPopupWindow">
<item name="android:popupBackground">#drawable/dropdown_selector</item>
<item name="android:textAppearance">#style/TextAppearance.Sherlock.Widget.PopupMenu</item>
</style>
<style name="TextAppearance.Sherlock.Widget.PopupMenu" parent="Widget">
<item name="android:textColor">#color/branco</item>
</style>
Try using
<item name="android:textAppearanceLargePopupMenu">
<!-- #style/some style that has android:textColor as attribute -->
</item> <!-- in Tema.Laranja style -->
Use actionBarWidgetTheme and android:textColor.
Example:
<style name="Theme.Guide" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="android:actionBarWidgetTheme">#style/ActionBar.Widget.Guide</item>
<item name="actionBarWidgetTheme">#style/ActionBar.Widget.Guide</item>
</style>
<style name="ActionBar.Widget.Guide" parent="Widget.Sherlock.ActionBar.Solid">
<item name="android:textColor">#android:color/white</item>
<item name="android:textSize">#dimen/action_bar_dropdown_menu_text_size</item>
</style>

Categories

Resources