ActionSherlockBar Styling - PopupMenu

Styling is a place to improve my knowledge of the Android platform. Given that I’m trying to make simple changes all morning and couldn’t achieve this.

I want to change the style of the overflow menu in the action bar. I was able to change the background color and add animations so that when I click on it it disappears to the selected color. But for the life of me I can’t change the color of the text.

Below are two screenshots, one using Theme.Sherlock and the other using Theme.Sherlock.Light.

Theme.Sherlock . This is my current setup that I configured. I want the overflow (aka android: popupmenu) to be in a bare theme (as shown below) and perfect so that I can change the color of the text.

Theme.Sherlock

Theme.Sherlock.Light. , . , , , .

Theme.Sherlock.Light

, . Theme.Sherlock.Light . "", , , , , , .

p.s. /, eclipse.

, , 2.3 .

<style name="AppTheme" parent="android:Theme.Holo.Light">
  <item name="android:actionOverflowButtonStyle">@style/OverFlow</item>
</style>

<style name="OverFlow" parent="@android:style/Widget.Holo.ActionButton.Overflow">
  <item name="android:src">**Insert your icon here**</item>
</style>
+5
4

, , , , . , . , , . android:itemTextAppearance .

<item name="android:itemTextAppearance">@style/your_new_text_appearance</item>

<style name="your_new_text_appearance">
    <item name="android:textColor">@color/red</item>
</style>
+3

ActionBarSherlock, OverFlow

path\to\android\android-sdk\platforms\android-api-level\data\res\drawable-resolution 

ic_menu_moreoverflow_normal_holo_dark.png ic_menu_moreoverflow_normal_holo_light.png

.

, . res\drawable.

+2

:

1. theme.xml :

<item name="popupMenuStyle">@style/PopupMenu</item>

2. styles.xml :

<style name="PopupMenu" parent="@style/Widget.Sherlock.Light.ListPopupWindow">
   <item name="android:textSize">14sp</item>
</style>

In style, you can override text size or other parameters as you want.

+2
source

Try overriding Theme.Sherlock style with the Android Action Style Generator

+1
source

All Articles