3

Hello i use ActionBarSherlock Version 4.0.0 and i dont know how to change/style the title text, under version 3.5 i used @style/abTextStyle. but that doenst work in version 4.0.0.

Thomas Dignan
  • 7,052
  • 3
  • 40
  • 48
MOST2K2
  • 255
  • 4
  • 14

1 Answers1

8

ABS 4 brought with it some major improvements, one being the styling via XML. If you read the documentation on styling, you would know that as of 4.0 -

Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation. Since both theming APIs are exactly the same you need only reference your customizations twice rather than having to implement them twice.

<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
    <item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
    <item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>

From this we can see that the ABS item reflects the native exactly, obviously without the android prefix.

This in short means that styling the native and ABS actionbar is now much simpler and to do any styling you should follow the standard Android docs on this, and then declare the styling you want like the example above (i.e. declare twice, once for native once for ABS).

This question ActionBar text color has some examples for what you want in its top voted answer, and if you want to be comforted: it was commented on by Jake Wharton who is the genius behind ABS.

Community
  • 1
  • 1
Graham Smith
  • 25,627
  • 10
  • 46
  • 69