7

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>

Than I use this it as

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

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..

enter image description here

Amit
  • 13,134
  • 17
  • 77
  • 148

3 Answers3

19

I solved the problem using a custom style.

  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>
    
  2. 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>
    
Amit
  • 13,134
  • 17
  • 77
  • 148
  • The `android:textAllCaps` attribute was introduced in API-14 which will render this solution invalid on pre-Ice Cream Sandwich platforms. I'm still looking for a working solution on, say API-11 (simply ommiting the `android:` part of the attribute doesn't work for some reason). Reference: http://developer.android.com/reference/android/R.attr.html#textAllCaps – dbm Mar 14 '14 at 05:45
  • 1
    @dbm ActionBarSherlock API used only devices prior to ICS (4.0.0). Above code is only for the pre ICS devices. Are you using ActionBarShelock API in your project ? – Amit Mar 19 '14 at 07:33
  • I'm sorry for wasting your time. I didn't read the question and your answer properly; I'm using ActionBarCompat, not Sherlock. – dbm Mar 19 '14 at 10:21
1

As far as I know ActionBar Shelock uses the same from the normal action bar. Based on that assumption:

a previous answer I gave ActionBar text color

and a generator http://jgilfelt.github.com/android-actionbarstylegenerator/

Community
  • 1
  • 1
Budius
  • 39,391
  • 16
  • 102
  • 144
  • that is an excellent answer.. But does that really solve my problem.. As you can see in the image I have already changed everything in the actionbar (background, textColor, textSize etc,).. My only problem is the behaviour of the text (SIGN IN and Join Meeting) on tabs.. Why their is special effect ? How can I get rid of that ? – Amit Oct 12 '12 at 11:40
0

In folder values add

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

In folder values-v14

<item name="android:actionBarTabTextStyle">@style/My.TabText.Style</item>
Adonias Vasquez
  • 1,014
  • 13
  • 11