2014-06-13 42 views
0

您好,我正在使用Sherlock庫來實現Android中的ActionBarTabs,但有一個奇怪的問題,Tabs中出現的文本都是大寫字母。我不想把所有的大寫字母都寫出來。我怎樣才能做到這一點?文字在Sherlock中的Action Bar Tabs中出現全部大寫

我嘗試這樣做,但這不是事先工作

價值觀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> 

感謝。

回答

5

這解決了我的問題。我用錯了父親風格Menu而不是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> 
相關問題