如何风格的Andr​​oid ActionaBar标签的文字? [英] How to style ActionaBar Tab text in Android?

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

问题描述

我使用ActionBarShrelock提供动作条为pre蜂窝设备。 我在的themes.xml文件以下code ...

I am using ActionBarShrelock to provide Action Bars for pre honeycomb devices. I have following code in my themes.xml file...

 <style name="My.Tab.Style" parent="@android:style/Widget.TabWidget">
        <item name="android:textAppearance">@style/MyCustomTabTextStyle</item>
    </style>

   <style name="MyCustomTabTextStyle" parent="Widget.Sherlock.ActionBar.TabText">
        <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
        <item name="android:textSize">14sp</item>
        <item name="android:textStyle">bold</item>
        <item name="android:textColor">@color/tabbar_text_color</item>
    </style>

比我使用它作为

<item name="android:actionBarTabTextStyle">@style/My.Tab.Style</item>
<item name="actionBarTabTextStyle">@style/My.Tab.Style</item>

任何一个可以解释为什么我收到了一些阴影选项卡中的最后一个字母?我怎样才能摆脱呢? plz帮助。我已经尝试了一切,但是那个影子是永远存在的。

Can any one explain why I am getting some shadow on the last letters of Tab ? How can I get rid of that ? plz help.. I have tried everything but that shadow is always there..

推荐答案

我解决了使用自定义风格的问题。

I solved the problem using a custom style.

  1. 首先,我创建了一个自定义样式

  1. First I created a custom style

<style name="My.TabText.Style" parent="@style/Widget.Sherlock.ActionBar.TabText">       
    <item name="android:textAppearance">@android:style/TextAppearance.Medium</item>
    <item name="android:textSize">16sp</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">@color/tabbar_text_color</item>
    <item name="android:textAllCaps">false</item>
    <!-- <item name="android:ellipsize">none</item> --> 
    <item name="android:maxLines">1</item>
</style>

  • 比我以前的风格在我的主题

  • Than i used that style in my Theme

    <item name="actionBarTabTextStyle">@style/My.TabText.Style</item>
    <item name="android:actionBarTabTextStyle">@style/My.TabText.Style</item>
    

  • 这篇关于如何风格的Andr​​oid ActionaBar标签的文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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