风格化的Actionbarsherlock标签风格、标签、Actionbarsherlock

2023-09-12 02:32:36 作者:遍体鳞伤美不美

所以,我想我的风格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

 
精彩推荐
图片推荐