2

I'm trying to remove ActionBar shadow that appears in this image:

enter image description here

Since now I've tried to add these lines in my xml theme:

 <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" >
    <item name="android:windowContentOverlay">@null</item>
</style>

And do it programmatically like this:

getSupportActionBar().setElevation(0);

as posted here.

But nothing is working for me...

My device is using last version of Android. Any idea on why is not working?

Community
  • 1
  • 1
Sonhja
  • 8,230
  • 20
  • 73
  • 131

2 Answers2

3

Add this property to your Toolbar or AppBarLayout (I don't know if you are using AppBarLayout):

app:elevation="0dp"
Michele Lacorte
  • 5,323
  • 7
  • 32
  • 54
0

Try using

<style name="AppTheme" parent="android:Theme.Holo.Light">
....
</style>

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

And in manifest

<activity
    android:theme="@style/NoActionBarShadowTheme"

And if you are using material design,try setting your toolbar elevation to 0dp.

Collins Abitekaniza
  • 4,496
  • 2
  • 28
  • 43