风格化的Actionbarsherlock标签 [英] Styling the Actionbarsherlock tabs

查看:120
本文介绍了风格化的Actionbarsherlock标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我想我的风格ActionBar的,这是我用ActionBarSherlock库已经实现的标签。这是我的code:

So I'm trying to style the tabs of my Actionbar, which I've implemented using the ActionBarSherlock library. This is my code:

<style name="Theme.AndroidDevelopers" parent="Theme.Sherlock.Light.ForceOverflow">
                <item name="actionBarTabStyle">@style/CustomActionBarStyle</item>
                <item name="android:actionBarTabStyle">@style/CustomActionBarStyle</item>

            <style name="CustomActionBarStyle" parent="Widget.Sherlock.Light.ActionBar.TabBar">
                <item name="android:background">@drawable/actionbar_tab_bg</item>
            </style>

在二,三线,如果我改变actionBarTabStyle到actionBarStyle,我的动作条本身变为我想要的风格(不是很顺利着,当然),所以连接做的工作。但是,试图改变动作条选项卡(下方),仍然没有成功。

At the second and third line, if I change actionBarTabStyle to actionBarStyle, my actionbar itself is changed to my wanted style (not very well, ofcourse), so the connections do work. However, trying to change the actionbar tabs (below it), has still no success.

我希望有人能帮助我。

与问候,

推荐答案

下面应该工作

<style name="Theme.app" parent="@style/Theme.Sherlock.Light">
        <item name="android:actionBarTabBarStyle">@style/Theme.app.tabbar.style</item>
        <item name="actionBarTabBarStyle">@style/Widget.app.ActionBar.TabBar</item>
</style>

<style name="Theme.app.tabbar.style" parent="@style/Theme.Sherlock.Light">
    <item name="android:background">#FF0000</item>
    <item name="background">#FF0000</item>
</style>

<style name="Widget.app.ActionBar.TabBar" parent="Widget.Sherlock.ActionBar.TabBar">
    <item name="android:background">#FF0000</item>
    <item name="background">#FF0000</item>
</style>

这使得使用TabBar红色。

This makes the tabBar red.

您需要设置两次actionBarTabBarStyle。这是由于Android> 3.0和Android&LT的; 3.0

You need to set two times the actionBarTabBarStyle. This is because of Android > 3.0 and Android <3.0

这篇关于风格化的Actionbarsherlock标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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