popupMenuStyle doesn't work when I change parent="@style/Theme.AppCompat.Light.DarkActionBar">

android, android-actionbar, themes

Solution

Check this generator to get working styles: http://jgilfelt.github.com/android-actionbarstylegenerator/

Basically when switching to DarkActionBar you need to update your styles to follow:

<style name="Theme.Example" parent="@style/Theme.AppCompat.Light.DarkActionBar">
   <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
   <!-- Light.DarkActionBar specific -->
   <item name="android:actionBarWidgetTheme">@style/Theme.Example.Widget</item>
</style>

<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Example.Widget" parent="@style/Theme.AppCompat">    
    <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>    
    <item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>    
</style>

Problem

When I change my theme styles ``` <style name="Theme.mystyle" parent="@style/Theme.AppCompat.Light"> ``` to ``` <style name="Theme.mystyle" parent="@style/Theme.AppCompat.Light.DarkActionBar"> ``` Not working at all. ``` <style name="PopupMenu.mystyle" parent="@style/Widget.AppCompat.Light.PopupMenu"> <item name="android:textStyle">bold</item> <item name="android:popupBackground">@drawable/menu_dropdown_panel</item> </style> ```

Original source