ActionbarSherlock操作栏自定义样式 [英] ActionbarSherlock action bar custom style

查看:92
本文介绍了ActionbarSherlock操作栏自定义样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的 Android 2.1的API 7 应用。为贯彻落实行动起来吧,我使用 ActionbarSherlock 库。

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>

但是我得到了错误:

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

为什么呢?而哪能风格福尔摩斯行动起来吧?

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

推荐答案

Theme.Sherlock 不是在Android命名空间。简单地删除 Android的: preFIX,这将解决您的错误

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

如果您使用的是第3版,有一个在样本/ 文件夹,让你如何正确样式操作栏的例子的风格的示例:

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:

这篇关于ActionbarSherlock操作栏自定义样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆