Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove ActionBar shadow on Android L (API 21)

Tags:

java

android

xml

i'm tring to remove the ActionBar Shadow in Android L. On API 14 this code works

<style name="AppBaseTheme" parent="Theme.AppCompat.Light"/>

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowContentOverlay">@null</item>                                    
</style>

But if i put the same code into /values-v21 not works. Any idea on how can i solve? Thanks.

like image 394
Giorgio Mirini Avatar asked Jul 01 '26 13:07

Giorgio Mirini


1 Answers

On Android 5.0, Action Bars use an elevation to provide the shadow. You can remove the elevation programmatically via getSupportActionBar().setElevation(0)

like image 144
ianhanniballake Avatar answered Jul 03 '26 01:07

ianhanniballake



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!