在覆盖 ActionBarSherlock 样式时遇到一些麻烦,希望有人可以提供帮助。我创建了一个像这样的drawable:
(在 res/drawable/actionbar_background.xml 中)
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg"
android:tileMode="repeat" />
然后在我的应用程序的样式文件中(在 res/values/style.xml 中)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:background">@drawable/actionbar_background</item>
</style>
<style name="my_theme" parent="@style/Theme.Sherlock.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
</style>
</resources>
结果是选择了 Theme.Sherlock.Light 样式(或者如果我交换它,则选择 Theme.Sherlock),但我没有对操作栏背景本身的样式进行任何更改。
谢谢