I’m just starting with ActionBarSherlock, I set a custom style:
<style name="AppTheme.ActionBar" parent="@style/Theme.Sherlock.Light">
<item name="actionBarStyle">@style/actionBarStyle</item>
<item name="android:actionBarStyle">@style/actionBarStyle</item>
</style>
<style name="actionBarStyle" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="android:background">@drawable/header_bar</item>
<item name="background">@drawable/header_bar</item>
<item name="android:displayOptions">showTitle</item>
<item name="displayOptions">showTitle</item>
</style>
and applied it to the Activity in manifest.
If I open the Activity’s XML layout file in Eclipse’s viewer I can see the background, but the displayOptions doesn’t change the viewer and I always see the default icon+logo.
running the app in the emulator show the ActionBar as expected.
why is this happening? is it possible to see the actual result in Eclipse’s layout editor?
I assume your build target is >API Level 13, so your GUI Editor in Eclipse is showing you the default ActionBar. ActionBarSherlock is a third party lib. It does not change the apperance of the XML Editor. So in short: No, AFAIK it’s not possible to see the actual ActionBarSherlock in the GUI Editor. If you want to see it you’ll have to style the default ActionBar as well(just to preview it).
To style the default ActionBar you’ll have to use these parent styles:
@android:style/Theme.Holo.Light(instead of@style/Theme.Sherlock.Light)and for the ActionBar:
@android:style/Widget.Holo.Light.ActionBar(instead of@style/Widget.Sherlock.Light.ActionBar)