android - setting custom style attribute for ActionBarSherlock navigation tabs breaks default theme -
i'm trying customize navigation tabs in actionbarsherlock. if set background navigation tabs, existing text styles tabs lost. text shrinks , left justified within tab. understanding setting 1 attribute, , merged parent theme. appears entirely replace parent theme. have set attributes customize 1 thing in navigation tabs?
here's code:
/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" > ...
if @ attributes of style widget.sherlock.light.actionbar.tabbar
, you'll notice there nothing text related inherit from.
<style name="widget.sherlock.actionbar.tabbar" parent="widget"> <item name="android:divider">?attr/actionbardivider</item> <item name="android:showdividers">middle</item> <item name="android:dividerpadding">12dip</item> </style> <style name="widget.sherlock.light.actionbar.tabbar" parent="widget.sherlock.actionbar.tabbar"> </style>
maybe looking actionbartabstyle
, actionbartabtextstyle
?
<item name="actionbartabstyle">@style/widget.sherlock.light.actionbar.tabview</item> <item name="actionbartabtextstyle">@style/widget.sherlock.light.actionbar.tabtext</item>
Comments
Post a Comment