当我更改主题样式时
<style name="Theme.mystyle" parent="@style/Theme.AppCompat.Light">
到
<style name="Theme.mystyle" parent="@style/Theme.AppCompat.Light.DarkActionBar">
根本不工作。
<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>
答案 0 :(得分:4)
选中此生成器以获取工作样式:http://jgilfelt.github.com/android-actionbarstylegenerator/
基本上,当切换到DarkActionBar时,您需要更新您的样式:
<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>