I'm trying to change the tab text of the ActionBarSherlock ActionBar tabs on < Android 3.0 devices.
On devices > Android 3.0 the text simply get wrapped in two lines. On devices < Android 3.0 the text is single line and seems to be set to ellipsize: marquee and marqueeRepeatLimit: marquee_forever.
I'm trying to change this on < Android 3.0 devices to also make the text two lines.
Here is what is try to do:
<style name="MyTheme" parent="@style/Theme.Sherlock">
<item name="actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>
</style>
<style name="MyActionBarTabTextStyle" parent="Widget.Sherlock.ActionBar.TabText">
<item name="android:ellipsize">end</item>
<item name="android:lines">2</item>
<item name="android:textColor">#f00</item>
</style>
The textColor
attribute is there to make sure that I am even doing the correct thing at all. And yes I am, the tab text is red.
But unfortunately the ellipsize setting doesn't seem to have any effect.
Any ideas on how to change this?
Although you probably don't need this anymore (considering the question is more than a year old), there might be someone landing here through a google search and might find this answer useful.
Changing the style to this will make it work:
<style name="MyTheme" parent="@style/Theme.Sherlock">
<item name="actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>
<item name="android:actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>
</style>
<style name="MyActionBarTabTextStyle" parent="Widget.Sherlock.ActionBar.TabText">
<item name="android:ellipsize">end</item>
<item name="android:lines">2</item>
<item name="android:textColor">#f00</item>
</style>
android:actionBarTabTextStyle
represents the TextStyle of the default ActionBar
for HC+ and actionBarTabTextStyle
the TextStyle for ActionBarSherlock
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With