我正在开发一个使用max api 21和appcompat-v7:21.0.0库的应用程序。在迁移到api 23并应用到同一版本后,theme .xml对api 21及以上版本没有影响。
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AAAActionBarTheme"
parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/AAAActionBar</item>
<item name="android:popupMenuStyle">@style/AAAPopupMenu</item>
<item name="android:itemTextAppearance">@style/AAAPopupMenuTextAppearance</item>
<item name="android:actionOverflowButtonStyle">@style/AAAPopupMenuButtonOverflow</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">@style/AAAActionBar</item>
<item name="popupMenuStyle">@style/AAAPopupMenu</item>
</style>
<style name="AAAActionBar"
parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
<item name="android:background">@color/action_bar</item>
<item name="android:textColor">@color/white</item>
<!-- Support library compatibility -->
<item name="background">@color/action_bar</item>
</style>
<style name="AAAPopupMenu"
parent="android:Widget.Holo.Light.ListPopupWindow">
<item name="android:popupBackground">@color/action_bar</item>
<!-- Support library compatibility -->
<item name="background">@color/action_bar</item>
</style>
<style name="AAAPopupMenuTextAppearance">
<item name="android:textColor">@color/white</item>
</style>
<style name="AAAPopupMenuButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">@drawable/ic_action_overflow</item>
</style>
</resources>
有人能帮我解决这个问题吗?谢谢你的帮助。
在AppCompat 23唯一已知的解决方案是改变新的工具栏与扩展AppCompatActivity,然后设置它与setSupportActionBar(工具栏)