问题
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>
回答1:
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>
来源:https://stackoverflow.com/questions/21381210/popupmenustyle-doesnt-work-when-i-change-parent-style-theme-appcompat-light-d