ActionBarSherlock のナビゲーション タブをカスタマイズしようとしています。単純にナビゲーション タブの背景を設定すると、タブの既存のテキスト スタイルが失われます。テキストが縮小され、タブ内で左揃えになります。私の理解では、1 つの属性を設定しており、それが親テーマにマージされています。親テーマを完全に置き換えるようです。ナビゲーション タブで 1 つの項目をカスタマイズするためだけに、すべての属性を設定する必要がありますか?
コードは次のとおりです。
/res/values/themes.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="Theme.Sherlock.Light">
<item name="android:dither">true</item>
<item name="android:actionBarTabStyle">@style/MyActionBarStyle</item>
<item name="actionBarTabStyle">@style/MyActionBarStyle</item>
</style>
<style name="MyActionBarStyle" parent="Widget.Sherlock.Light.ActionBar.TabBar">
<item name="android:background">@drawable/my_new_bg</item>
</style>
</resources>
androidmanifest.xml:
...
<application
android:name=".MyApplication"
android:hardwareAccelerated="true"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:description="@string/app_desc"
android:theme="@style/MyTheme" >
...