Skip to content Skip to sidebar Skip to footer

Customizing Action Bar Sherlock

I have implemented Action bar Sherlock with theme.sherlock. The action bar has navigation tab. I have used styles for customizing the action bar. The style xml is shown below <

Solution 1:

All you have to do is setting the background property of your xml. You can set the "color" transparent to remove it.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- Bottom Line -->
    <item>
        <shape android:shape="rectangle">
            <solid android:color="@android:color/transparent" />
        </shape>
    </item>

    <!-- Color of your action bar -->
    <item android:bottom="2dip">
        <shape android:shape="rectangle">
            <solid android:color="@color/action_bar_color" />
        </shape>
    </item>
</layer-list>

Afterwards apply it in your theme:

<style name="Widget.MyTheme.ActionBar" parent="Widget.Sherlock.ActionBar">
    <item name="android:background">@drawable/action_bar_background</item>
    <item name="background">@drawable/action_bar_background</item>
</style>

Post a Comment for "Customizing Action Bar Sherlock"