ActionbarSherlock action bar custom style

混江龙づ霸主 提交于 2019-12-21 06:45:10

问题


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:


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:



来源:https://stackoverflow.com/questions/9310501/actionbarsherlock-action-bar-custom-style

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!