ActionbarSherlock action bar custom style

2019-04-02 22:19发布

I am developing Android 2.1 API 7 app. To implement action bar, I am using ActionbarSherlock library.

I have successfully imported sherlock library to my project, and created the action bar in my app. Then, I would like to customize the style of sherlock action bar. So, I defined the following style file:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="ActionBarTheme" parent="android:style/Theme.Sherlock">
        <item name="android:background">@drawable/action_bar_background</item>
    </style>
</resources>

But I got error :

No resource found that matches the given name "android:style/Theme.Sherlock"

Why? and how can I style sherlock Action bar ??

1条回答
2楼-- · 2019-04-02 22:44

Theme.Sherlock is not in the Android namespace. Simply remove the android: prefix and that will resolve your error.

If you're using version 3, there is a styled sample in the samples/ folder which gives you an example of how to properly style the action bar:

查看更多
登录 后发表回答