如何在actionbarsherlock中更改标签“下划线"的颜色 [英] How to change the color of tab 'underbar' in actionbarsherlock

查看:25
本文介绍了如何在actionbarsherlock中更改标签“下划线"的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我失去了更多的理智.我无法找到/理解如何设计该死的东西.我设法更改了选项卡本身的背景,但无法更改所选选项卡下栏的颜色.

Ok i'm loosing more sanity then ever. I can't find/understand how to style the damn thing. I managed to change the background of the tab itself but I can't cahnge the color of the bar under the selected tab.

如何将它从蓝色变为某种东西.

How to change it from blue to something.

不幸的是,我的 styles.xml 我对它的工作原理非常了解

My styles.xml unfortunately I have very bad understanding of how it works

<?xml version="1.0" encoding="utf-8"?>
<resources>


    <style name="Theme.Styled" parent="Theme.Sherlock.Light">
        <item name="actionBarTabStyle">@style/Widget.Styled.ActionBarTab</item>
        <item name="android:actionBarTabStyle">@style/Widget.Styled.ActionBarTab</item>

        <item name="actionBarTabBarStyle">@style/Widget.Styled.ActionBarTabBar</item>
        <item name="android:actionBarTabBarStyle">@style/Widget.Styled.ActionBarTabBar</item>

        <item name="actionBarTabTextStyle">@style/myText</item>
        <item name="android:actionBarTabTextStyle">@style/myText</item>


    </style>

    <style name="Widget.Styled.ActionBarTab" parent="Widget.Sherlock.Light.ActionBar.TabView">
    <!--    <item name="background">@drawable/startbcg</item>
        <item name="android:background">@drawable/startbcg</item>
        <item name="backgroundSplit">@drawable/bg_striped_split</item>
        <item name="android:backgroundSplit">@drawable/bg_striped_split</item>
    -->
    </style>


    <style name="Widget.Styled.ActionBarTabBar" parent="Widget.Sherlock.Light.ActionBar.TabBar">

        <item name="background">@drawable/startbcg</item>
        <item name="android:background">@drawable/startbcg</item>
         <item name="backgroundSplit">@drawable/bg_striped_split</item>
        <item name="android:backgroundSplit">@drawable/bg_striped_split</item>

    </style>

    <style name="myText" parent="Widget.Sherlock.Light.ActionBar.TabText">
        <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
        <item name="android:textColor">@android:color/primary_text_dark</item>
        <item name="android:textSize">10sp</item>


    </style>
<style name="myTextInv" parent="Widget.Sherlock.Light.ActionBar.TabText.Inverse">
        <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
        <item name="android:textColor">@android:color/primary_text_dark</item>
        <item name="android:textSize">10sp</item>


    </style>
</resources>

额外问题:我在哪里可以找到某些东西的属性(如背景).

Bonus question: where I can find what properties (like background) certain stuff has.

推荐答案

使用 ActionbarStyleGenerator 来设置 Actionbar 的样式.这是迄今为止最简单、最直观的方式.

Use ActionbarStyleGenerator to style the Actionbar. This is by far the simplest and most intuitive way.

如何:

  1. 使用 UI 为不同的项目选择颜色
  2. 完成后点击下载 .ZIP"
  3. ZIP 文件包含您必须复制到项目 res/layout 和res/drawableXXXX 文件夹

这篇关于如何在actionbarsherlock中更改标签“下划线"的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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