Android 为什么ActionBar不显示我的自定义颜色? @style/Widget.MyActionBar #AF0814 #AF0814
这是我的custom style.xml,我想更改ActionBar的背景。它在我的虚拟设备1(平台:2.2 API级别:8)中运行良好。但在虚拟设备2(平台:4.4 API级别:19)中不显示我的自定义颜色 虚拟设备1: 虚拟设备二:Android 为什么ActionBar不显示我的自定义颜色? @style/Widget.MyActionBar #AF0814 #AF0814,android,android-actionbar,actionbarsherlock,Android,Android Actionbar,Actionbarsherlock,这是我的custom style.xml,我想更改ActionBar的背景。它在我的虚拟设备1(平台:2.2 API级别:8)中运行良好。但在虚拟设备2(平台:4.4 API级别:19)中不显示我的自定义颜色 虚拟设备1: 虚拟设备二: 拆下下面的行并参见 <style name="Theme.PageIndicatorDefaults" parent="Theme.Sherlock.Light"> <item name="actionBarStyle">@st
拆下下面的行并参见
<style name="Theme.PageIndicatorDefaults" parent="Theme.Sherlock.Light">
<item name="actionBarStyle">@style/Widget.MyActionBar</item>
</style>
<style name="Widget.MyActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">#AF0814</item>
<item name="background">#AF0814</item>
</style>
#AF0814
在values-v11和values-v14文件夹的style.xml文件中也复制粘贴相同的代码
<item name="background">#AF0814</item>
@style/Widget.MyActionBar
#AF0814
#AF0814
希望这有帮助您需要添加一行
<style name="Theme.PageIndicatorDefaults" parent="Theme.Sherlock.Light">
<item name="actionBarStyle">@style/Widget.MyActionBar</item>
</style>
<style name="Widget.MyActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">#AF0814</item>
<item name="background">#AF0814</item>
</style>
@style/Widget.MyActionBar
@style/Widget.MyActionBar
您是否也修改了values-v11和values-v14文件?如果您没有创建这些文件,请重新创建并定义样式。@user2247689不起作用。。当我修改values-v14中的其他属性(如android:PaddingBotton of the styles.xml)时,它会起作用。@CAGE您正在测试哪种类型的AVD?
<style name="Theme.PageIndicatorDefaults" parent="Theme.Sherlock.Light">
<item name="actionBarStyle">@style/Widget.MyActionBar</item>
<item name="android:actionBarStyle">@style/Widget.MyActionBar</item>
</style>