actionMenuTextColor desn´t work

5,561 views
Skip to first unread message

Jesús Gumiel

unread,
Apr 26, 2012, 6:25:17 AM4/26/12
to ActionBarSherlock
I can´t change the color of the text of my menu :(.

This is my code:

<style name="Theme.Custom"
parent="Theme.Sherlock.Light.ForceOverflow">

<item name="actionMenuTextAppearance">@style/
Theme.Styled.Custom</item>
<item name="actionMenuTextColor">@color/orange</item>

<item name="android:actionMenuTextAppearance">@style/
Theme.Custom.Title</item>
<item name="android:actionMenuTextColor">@color/orange</item>
</style>

<style name="Theme.Custom.Title">
<item name="android:textSize">16sp</item>
<item name="android:textColor">@color/orange</item>
</style>

It doesn´t work to change the textAppearence of the titile neither.
Any idea?

I´m testing with a galaxy nexus 4.0

Fab

unread,
Apr 30, 2012, 7:10:52 PM4/30/12
to ActionBarSherlock
Did you solved it ? I need to define action menu text color.

Paul

unread,
May 3, 2012, 9:13:26 AM5/3/12
to ActionBarSherlock
You have to enter the attribute in the general theme, not in the
actionbar style. This works for me:

<style name="My.Theme" parent="Theme.Sherlock.Light">
        <item name="android:actionMenuTextColor">@android:color/white</
item>
</style>

Fabien

unread,
May 4, 2012, 2:52:13 PM5/4/12
to actionba...@googlegroups.com
Thank you but it does not work for me :
<style name="KTTheme" parent="Theme.Sherlock.Light">
<item name="android:actionMenuTextColor">@color/red</item>
</style>


2012/5/3 Paul <zum...@gmail.com>:
> Theme.Sherlock.Light

Jake Wharton

unread,
May 4, 2012, 3:07:13 PM5/4/12
to actionba...@googlegroups.com
That affects ICS only. You should also add a non-android prefixed version to apply it to pre-ICS.

<style name="KTTheme" parent="Theme.Sherlock.Light">
       <item name="android:actionMenuTextColor">@color/red</item>
       <item name="actionMenuTextColor">@color/red</item>
</style>


---
Jake Wharton
http://about.me/jakewharton

Fabien

unread,
May 5, 2012, 3:10:11 PM5/5/12
to actionba...@googlegroups.com
Thank you but I removed all my theme content and I exactly
copied/paste your code. There is no effect on the text color of the
action bar menu !


2012/5/4 Jake Wharton <jakew...@gmail.com>:

Fabien

unread,
May 8, 2012, 5:50:08 PM5/8/12
to actionba...@googlegroups.com
Do you know why I've no text color changed ? Are you sure it works for you ?

2012/5/5 Fabien <fab...@gmail.com>:

Mike Carter

unread,
May 14, 2012, 12:57:50 PM5/14/12
to actionba...@googlegroups.com
I can confirm this.  Seems like ABS doesn't honor either of the following:

        <item name="actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>

        <item name="actionMenuTextColor">@color/my_color</item>

        <item name="android:actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>

        <item name="android:actionMenuTextColor">@color/my_color</item>

Fabien

unread,
May 20, 2012, 9:39:57 AM5/20/12
to actionba...@googlegroups.com
Jake, are you able to reproduce this bug ?


2012/5/14 Mike Carter <carte...@me.com>:

Tim

unread,
May 22, 2012, 10:25:59 AM5/22/12
to actionba...@googlegroups.com
I'm seeing this issue too, has it been accepted as a bug?

SimonVT

unread,
May 22, 2012, 11:36:20 AM5/22/12
to actionba...@googlegroups.com
If the android:-prefixed attributes are not picked up on ICS, then this is not an ABS bug.

SimonVT

unread,
May 22, 2012, 11:47:35 AM5/22/12
to actionba...@googlegroups.com
I just tried, both attributes works fine. Defined directly in theme set in manifest.

Fabien

unread,
May 22, 2012, 4:26:05 PM5/22/12
to actionba...@googlegroups.com
Sorry, I don't understand.

Could you give us an example ?

I add this in my theme :
<style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="actionMenuTextColor">@color/red_light</item>
<item name="android:actionMenuTextColor">@color/red_light</item>
</style>


2012/5/22 SimonVT <sim...@gmail.com>:

Tim

unread,
May 22, 2012, 5:04:35 PM5/22/12
to actionba...@googlegroups.com
Yeah I've done likewise and see no change in the UI. Could you give us any pointers?

Cheers,
TIm

Jonathan Steele

unread,
May 22, 2012, 9:18:48 PM5/22/12
to actionba...@googlegroups.com
did you add it to android:theme in Androidmainfest.xml?

SimonVT

unread,
May 23, 2012, 3:26:05 PM5/23/12
to actionba...@googlegroups.com
Add the attributes to your theme, set it in manifest.

<style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
    <item name="actionMenuTextColor">@color/red</item>
    <item name="android:actionMenuTextColor">@color/red</item>
</style>

<application android:label="@string/app_name" android:theme="@style/MyTheme">

Fabien

unread,
May 24, 2012, 4:47:48 PM5/24/12
to actionba...@googlegroups.com
Thank you, I do what you described but there is no effect on my application !


2012/5/23 SimonVT <sim...@gmail.com>:

chris

unread,
May 29, 2012, 6:37:42 PM5/29/12
to ActionBarSherlock
I had the same problem with "android:actionMenuTextAppearance" not
working even when it was in my main theme and testing my app on a
Nexus. I'm not sure if its the correct solution, but after looking at
the source code for action bar, I used
"android:textAppearanceLargePopupMenu" instead for my custom menu text
appearance. Alternatively, you can just add <item
name="android:textAppearanceLargePopupMenu">?android:attr/
actionMenuTextAppearance</item> and then your
"android:actionMenuTextAppearance" should work. I'm not sure how this
affects other parts of your app though, so use it wisely, and make
sure to check your app on older versions of android too. I use a
values-v11 folder for my new action bar themes and styles.

On May 24, 1:47 pm, Fabien <fabr...@gmail.com> wrote:
> Thank you, I do what you described but there is no effect on my application !
>
> 2012/5/23 SimonVT <simo...@gmail.com>:
>
>
>
>
>
>
>
> > Add the attributes to your theme, set it in manifest.
>
> > <style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
> >     <item name="actionMenuTextColor">@color/red</item>
> >     <item name="android:actionMenuTextColor">@color/red</item>
> > </style>
>
> > <application android:label="@string/app_name"
> > android:theme="@style/MyTheme">
>
> > On Tuesday, May 22, 2012 11:04:35 PM UTC+2, Tim wrote:
>
> >> Yeah I've done likewise and see no change in the UI. Could you give us any
> >> pointers?
>
> >> Cheers,
> >> TIm
>
> >> On Tuesday, May 22, 2012 9:26:05 PM UTC+1, Fab wrote:
>
> >>> Sorry, I don't understand.
>
> >>> Could you give us an example ?
>
> >>> I add this in my theme :
> >>> <style name="MyTheme" parent="Theme.Sherlock.Light.DarkActionBar">
> >>>   <item name="actionMenuTextColor">@color/red_light</item>
> >>>   <item name="android:actionMenuTextColor">@color/red_light</item>
> >>> </style>
>
> >>> 2012/5/22 SimonVT <simo...@gmail.com>:
> >>> > I just tried, both attributes works fine. Defined directly in theme set
> >>> > in
> >>> > manifest.
>
> >>> > On Tuesday, May 22, 2012 5:36:20 PM UTC+2, SimonVT wrote:
>
> >>> >> If the android:-prefixed attributes are not picked up on ICS, then
> >>> >> this is
> >>> >> not an ABS bug.
>
> >>> >> On Tuesday, May 22, 2012 4:25:59 PM UTC+2, Tim wrote:
>
> >>> >>> I'm seeing this issue too, has it been accepted as a bug?
>
> >>> >>> On Sunday, May 20, 2012 2:39:57 PM UTC+1, Fab wrote:
>
> >>> >>>> Jake, are you able to reproduce this bug ?
>
> >>> >>>> 2012/5/14 Mike Carter <carter.m...@me.com>:
> >>> >>>> > I can confirm this.  Seems like ABS doesn't honor either of the
> >>> >>>> > following:
>
> >>> >>>> >         <item
>
> >>> >>>> > name="actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>
>
> >>> >>>> >         <item name="actionMenuTextColor">@color/my_color</item>
>
> >>> >>>> >   <item name="android:actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>
>
> >>> >>>> >   <item name="android:actionMenuTextColor">@color/my_color</item>
>
> >>> >>>> > On Tuesday, May 8, 2012 5:50:08 PM UTC-4, Fab wrote:
>
> >>> >>>> >> Do you know why I've no text color changed ? Are you sure it
> >>> >>>> >> works
> >>> >>>> >> for you
> >>> >>>> >> ?
>
> >>> >>>> >> 2012/5/5 Fabien <fabr...@gmail.com>:
> >>> >>>> >> > Thank you but I removed all my theme content and I exactly
> >>> >>>> >> > copied/paste your code. There is no effect on the text color of
> >>> >>>> >> > the
> >>> >>>> >> > action bar menu !
>
> >>> >>>> >> > 2012/5/4 Jake Wharton <jakewhar...@gmail.com>:
> >>> >>>> >> >> That affects ICS only. You should also add a non-android
> >>> >>>> >> >> prefixed
> >>> >>>> >> >> version to
> >>> >>>> >> >> apply it to pre-ICS.
>
> >>> >>>> >> >> <style name="KTTheme" parent="Theme.Sherlock.Light">
> >>> >>>> >> >>        <item
> >>> >>>> >> >> name="android:actionMenuTextColor">@color/red</item>
> >>> >>>> >> >>        <item name="actionMenuTextColor">@color/red</item>
> >>> >>>> >> >> </style>
>
> >>> >>>> >> >> ---
> >>> >>>> >> >> Jake Wharton
> >>> >>>> >> >>http://about.me/jakewharton
>
> >>> >>>> >> >> On Fri, May 4, 2012 at 11:52 AM, Fabien <fabr...@gmail.com>
> >>> >>>> >> >> wrote:
>
> >>> >>>> >> >>> Thank you but it does not work for me :
> >>> >>>> >> >>> <style name="KTTheme" parent="Theme.Sherlock.Light">
> >>> >>>> >> >>>        <item
> >>> >>>> >> >>> name="android:actionMenuTextColor">@color/red</item>
> >>> >>>> >> >>> </style>
>
> >>> >>>> >> >>> 2012/5/3 Paul <zum...@gmail.com>:
> >>> >>>> >> >>> > Theme.Sherlock.Light
>
> >>> >> On Tuesday, May 22, 2012 4:25:59 PM UTC+2, Tim wrote:
>
> >>> >>> I'm seeing this issue too, has it been accepted as a bug?
>
> >>> >>> On Sunday, May 20, 2012 2:39:57 PM UTC+1, Fab wrote:
>
> >>> >>>> Jake, are you able to reproduce this bug ?
>
> >>> >>>> 2012/5/14 Mike Carter <carter.m...@me.com>:
> >>> >>>> > I can confirm this.  Seems like ABS doesn't honor either of the
> >>> >>>> > following:
>
> >>> >>>> >         <item
>
> >>> >>>> > name="actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>
>
> >>> >>>> >         <item name="actionMenuTextColor">@color/my_color</item>
>
> >>> >>>> >   <item name="android:actionMenuTextAppearance">@style/TextAppearance.MyTheme.Widget.ActionBar.Menu</item>
>
> >>> >>>> >   <item name="android:actionMenuTextColor">@color/my_color</item>
>
> >>> >>>> > On Tuesday, May 8, 2012 5:50:08 PM UTC-4, Fab wrote:
>
> >>> >>>> >> Do you know why I've no text color changed ? Are you sure it
> >>> >>>> >> works
> >>> >>>> >> for you
> >>> >>>> >> ?
>
> >>> >>>> >> 2012/5/5 Fabien <fabr...@gmail.com>:
> >>> >>>> >> > Thank you but I removed all my theme content and I exactly
> >>> >>>> >> > copied/paste your code. There is no effect on the text color of
> >>> >>>> >> > the
> >>> >>>> >> > action bar menu !
>
> >>> >>>> >> > 2012/5/4 Jake Wharton <jakewhar...@gmail.com>:
> >>> >>>> >> >> That affects ICS only. You should also add a non-android
> >>> >>>> >> >> prefixed
> >>> >>>> >> >> version to
> >>> >>>> >> >> apply it to pre-ICS.
>
> >>> >>>> >> >> <style name="KTTheme" parent="Theme.Sherlock.Light">
> >>> >>>> >> >>        <item
> >>> >>>> >> >> name="android:actionMenuTextColor">@color/red</item>
> >>> >>>> >> >>        <item name="actionMenuTextColor">@color/red</item>
> >>> >>>> >> >> </style>
>
> >>> >>>> >> >> ---
> >>> >>>> >> >> Jake Wharton
> >>> >>>> >> >>http://about.me/jakewharton
>
> >>> >>>> >> >> On Fri, May 4, 2012 at 11:52 AM, Fabien <fabr...@gmail.com>

chris

unread,
May 29, 2012, 6:56:15 PM5/29/12
to ActionBarSherlock
I also found that override "android:itemTextAppearance" changed the
text in the action menu as well. Like my other solution, I'm not sure
how it affects other parts of your app or menu's on older OS's.

<item name="android:itemTextAppearance">?android:attr/
actionMenuTextAppearance</item>
<item name="android:actionMenuTextAppearance">@style/
MyCustomActionBarMenuTextAppearance</item>

Fabien

unread,
May 31, 2012, 2:38:45 AM5/31/12
to actionba...@googlegroups.com
Thank you Chris !

Jake, could you give us the best practice to set the action bar menu
text color ?

Fabien


2012/5/30 chris <fei...@gmail.com>:

Fabien

unread,
Jun 14, 2012, 1:56:08 AM6/14/12
to actionba...@googlegroups.com
Jake ?


2012/5/31 Fabien <fab...@gmail.com>:

Calimero

unread,
Aug 1, 2012, 10:17:09 AM8/1/12
to actionba...@googlegroups.com
Doesn't work for me neither the attributes actionMenuTextColor and actionMenuTextAppearance

Fabien

unread,
Aug 3, 2012, 1:53:35 PM8/3/12
to actionba...@googlegroups.com
Indeed, I didn't found a solution yet.


2012/8/1 Calimero <julien.c...@googlemail.com>:

Jean-Baptiste Lernout

unread,
Sep 20, 2012, 6:58:02 AM9/20/12
to actionba...@googlegroups.com
This seems to work :

   <style name="MyTheme parent="Theme.Sherlock.Light.DarkActionBar">
        <item name="textAppearanceLargePopupMenu">@style/MyActionMenuTextAppearance.Large</item>
        <item name="android:textAppearanceLargePopupMenu">@style/MyActionMenuTextAppearance.Large</item>

        <item name="textAppearanceSmallPopupMenu">@style/MyActionMenuTextAppearance.Small</item>
        <item name="android:textAppearanceSmallPopupMenu">@style/MyActionMenuTextAppearance.Small</item>
    </style>

    <style name="MyActionMenuTextAppearance.Large" parent="@style/TextAppearance.Sherlock.Widget.PopupMenu.Large">
        <item name="android:textColor">#FFC0C0C0</item>
    </style>

    <style name="MyActionMenuTextAppearance.Small" parent="@style/TextAppearance.Sherlock.Widget.PopupMenu.Small">
        <item name="android:textColor">#FFC0C0C0</item>
    </style>

JB

Fabien

unread,
Sep 20, 2012, 4:40:43 PM9/20/12
to actionba...@googlegroups.com
Thank you very much but it doesn't work for me (4.1 and 2.3)

Calimero, did you try too ?

Fabien


2012/9/20 Jean-Baptiste Lernout <jb.le...@gmail.com>:

Andrei Pop

unread,
Sep 24, 2012, 11:51:41 AM9/24/12
to actionba...@googlegroups.com
The parent has to be 
Theme.Sherlock.Light as Jake mentioned above

This works for me:

<style name="KTTheme" parent="Theme.Sherlock.Light">
       <item name="android:actionMenuTextColor">@color/red</item>
       <item name="actionMenuTextColor">@color/red</item>
</style>

Roman Truba

unread,
Sep 1, 2013, 9:58:23 PM9/1/13
to actionba...@googlegroups.com
Works for me, thank you very much

четверг, 20 сентября 2012 г., 18:58:02 UTC+8 пользователь Jean-Baptiste Lernout написал:
Reply all
Reply to author
Forward
0 new messages