1

I've create a very simple linear layout below the action bar but now in Android 5.0 Lollipop (emulator) it's applied a gradient as you can see but it isn't set at all! I simply set the android:background of linear layout. Is it a bug? How can I avoid that gradient? In the developer preview there wasn't any problem.

enter image description here

greywolf82
  • 21,813
  • 18
  • 54
  • 108

2 Answers2

1

Found a workaround for Lillipop:

<style name="MyTheme.BigActionBarStyle" parent="@android:style/Widget.Material.ActionBar">
        <item name="android:background">@color/colorPrimary</item>
        <item name="android:elevation">0dp</item> <----With this line work
        <item name="android:displayOptions"></item>
</style>
greywolf82
  • 21,813
  • 18
  • 54
  • 108
  • You could also set your action bar background to null or transparent, which will prevent it from casting a shadow. – alanv Oct 18 '14 at 22:52
-1

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>

Source

Community
  • 1
  • 1
Amy
  • 4,034
  • 1
  • 20
  • 34
  • Yes this issue already submitted to Google (Android) developer team:https://code.google.com/p/android-developer-preview/issues/detail?id=1486.. Sorry for wrong answer – Amy Oct 18 '14 at 10:35
  • 1
    Material doesn't use a window content overlay. It's an actual elevation-based shadow. – alanv Oct 18 '14 at 22:51