我正尝试在应用程序中更改操作栏的颜色。我找到了this answer这表明了一种方法。所以,我创建了一个themes.xml
文件res/values
文件夹下有以下几点:如何使用actionbarsherlock更改操作栏的颜色
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.MyTheme" parent="Theme.Sherlock.ForceOverFlow">
<item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
<item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item>
</style>
<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
<item name="android:background">#fff4231e</item>
<item name="background">#fff4231e</item>
</style>
</resources>
不过,我得到在上面的代码中的错误:
的项目在我的build.gradle错误检索父:没有资源发现匹配 名称为'Theme.Sherlock.ForceOverFlow'。
我有以下几点:
compile 'com.actionbarsherlock:actionbarsherlock:[email protected]'
我使用AndroidStudio和摇篮
如果你正在使用Eclipse,我有时编辑我的风格的时候会有奇怪解析错误。 xml文件。您是否尝试打开“问题”窗口,删除错误消息并尝试重建项目? - 另外,如果您使用的是4.2.0或更高版本,那么显然它已被删除:http://stackoverflow.com/a/13180285/1426565 – Guardanis