Remove shadow below actionbar Remove shadow below actionbar android android

Remove shadow below actionbar


What is the style item to make it disappear?

In order to remove the shadow add this to your app theme:

<style name="MyAppTheme" parent="android:Theme.Holo.Light">    <item name="android:windowContentOverlay">@null</item></style>

UPDATE:As @Quinny898 stated, on Android 5.0 this has changed, you have to call setElevation(0) on your action bar. Note that if you're using the support library you must call it to that like so:

getSupportActionBar().setElevation(0);


For Android 5.0, if you want to set it directly into a style use:

<item name="android:elevation">0dp</item>

and for Support library compatibility use:

<item name="elevation">0dp</item>

Example of style for a AppCompat light theme:

<style name="Theme.MyApp.ActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">    <!-- remove shadow below action bar -->    <!-- <item name="android:elevation">0dp</item> -->    <!-- Support library compatibility -->    <item name="elevation">0dp</item></style>

Then apply this custom ActionBar style to you app theme:

<style name="Theme.MyApp" parent="Theme.AppCompat.Light">    <item name="actionBarStyle">@style/Theme.MyApp.ActionBar</item></style>

For pre 5.0 Android, add this too to your app theme:

<!-- Remove shadow below action bar Android < 5.0 --><item name="android:windowContentOverlay">@null</item>


On Android 5.0 this has changed, you have to call setElevation(0) on your action bar. Note that if you're using the support library you must call it to that like so:

getSupportActionBar().setElevation(0);

It's unaffected by the windowContentOverlay style item, so no changes to styles are required