0
我想将自定义背景添加到AppCompat操作栏。这是我的风格禁用操作栏的默认背景并添加自定义背景
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<item name="android:actionBarStyle">@style/MyActionBar</item>
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<!-- ActionBar styles -->
<style name="MyActionBar" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:background">@drawable/top_bar_bg</item>
</style>
我使用AppTheme我的主题。它仍然显示默认的黑暗背景。我在这里错过了什么?
试过更换仍然没有工作 – 2014-12-05 11:43:50
您是否使用了最新的更新支持库v7的?如果是,那么现在通过Material Design可以使用'android:colorPrimary'属性指定动作栏颜色。 – 2014-12-05 11:47:08