Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
435 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...