Search code examples
androidandroid-actionbaractionbarsherlock

Text appear all caps in Action Bar Tabs in Sherlock


Hello I am using the Sherlock library to achieve the ActionBarTabs in Android but there is some weird issue that text appear in the Tabs are all caps. I dont want to make all caps to captital. How can I achive this ?

I tried this but this is not working

values-v14.xml

<style name="TariffPlansTheme" parent="Theme.Sherlock">
    <item name="actionMenuTextAppearance">@style/MyMenuTextAppearance</item>
    <item name="android:actionMenuTextAppearance">@style/MyMenuTextAppearance</item>
</style>

<style name="MyMenuTextAppearance" parent="TextAppearance.Sherlock.Widget.ActionBar.Menu">
    <item name="android:textAllCaps">false</item>
</style>

AndroidManifest.xml

<activity
    android:name="TariffPlansActivity"
    android:label="@string/title_activity_tariff_plans"
    android:screenOrientation="portrait" 
    android:theme="@style/TariffPlansTheme">
</activity>

Thanks in advance.


Solution

  • This solved my issue. I was using wrong parent style Menu instead of Tab

    <resources>
    
        <style name="AppTheme" parent="android:Theme.Holo.Light" />
    
        <style name="TariffPlansTheme" parent="Theme.Sherlock">
            <item name="actionBarTabTextStyle">@style/My.TabText.Style</item>
            <item name="android:actionBarTabTextStyle">@style/My.TabText.Style</item>
        </style>
    
        <style name="My.TabText.Style" parent="@style/Widget.Sherlock.ActionBar.TabText">
            <item name="android:textAllCaps">false</item>
        </style>
    
    </resources>