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.
Asked
Active
Viewed 743 times
1
-
Make screen with no Action bar like: android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" in android manifest – Amy Oct 18 '14 at 09:52
-
@AmolTate No I can't. I need the action bar as you can see. – greywolf82 Oct 18 '14 at 10:13
2 Answers
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>
-
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
-
1Material doesn't use a window content overlay. It's an actual elevation-based shadow. – alanv Oct 18 '14 at 22:51