Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting ActionBar Elevation on pre-5.0 devices with AppCompat

I want to remove the shadow from the ActionBar and I read you do this:

getSupportActionBar().setElevation(0)

However this didn't seem to work on Pre 5.0 devices. Is that a bug? I am not using the Toolbar. Just regular ActionBar from the library.

like image 669
TheLettuceMaster Avatar asked Oct 26 '14 13:10

TheLettuceMaster


1 Answers

If you are using the ActionBar (not the Toolbar) you should be able to remove the shadow below using this style:

<style name="MyAppTheme" parent="Theme.AppCompat.Light">
    <item name="android:windowContentOverlay">@null</item>
</style>
like image 81
Gabriele Mariotti Avatar answered Oct 14 '22 12:10

Gabriele Mariotti