Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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>
like image 878
Cabezas Avatar asked Oct 02 '22 18:10

Cabezas


1 Answers

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>
like image 65
Sergii Pechenizkyi Avatar answered Oct 16 '22 14:10

Sergii Pechenizkyi