2

I want to change the background and text colors of the pop up menu that appears when the user presses the overflow icon.

If I use Theme.Holo or Theme.Holo.Light it works, but I'm using Theme.Holo.Light.DarkActionBar and it never works. I'm starting to assume that it's an Android bug.

I'm testing on a Nexus 4 with 4.4.2 but it also doesn't work on an emulator with API 19.

After trying a lot of potential solutions that I came across here in StackOverflow, here is what I'm doing:

<style name="Theme.MyApp" parent="android:Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarWidgetTheme">@style/ActionBarWidget</item>
</style>

<style name="AndroidPitActionBarWidget" parent="android:Theme.Holo.Light">
    <item name="android:popupMenuStyle">@android:style/Widget.Holo.Light.PopupMenu</item>
    <item name="android:dropDownListViewStyle">@android:style/Widget.Holo.Light.ListView.DropDown</item>
</style>

That works but it changes the styling of the SearchView, which is another pain to change. So I'm not considering this a solution.

What I want is to just change the background/text of the popup to the Light version, which is light background with black text.

I also tried setting those two attributes in the main theme instead of using the actionBarWidgetTheme.

It's really frustrating to waste hours on this kind of problems.

I also tried using Action Bar Style Generator to make the background white, but then the text is white and I can't change it to black.

Thanks very much in advance.

Henrique Rocha
  • 1,737
  • 1
  • 19
  • 29
  • Was my answer not able to help? If it was, please remember to accept it as an answer. If not, comment so that I'll have some better idea of what problems you're having. – GrouchyPanda Apr 07 '14 at 20:33

1 Answers1

0

If you set the background color of that panel using the theme you get in the Action Bar Style Generator, you can try adding the android:textColor attribute of the drop down ListView.

If that does not work, you can alternately set the string color in code during your onCreateOptionsMenu method as detailed on this SO thread

Community
  • 1
  • 1
GrouchyPanda
  • 1,004
  • 8
  • 20