7

I've tried to reproduce Google's elevation example presented here:

https://developer.android.com/training/material/shadows-clipping.html

But for me no shadows are showing up. Not in the Android Studio designer, not on the AVD emulator. I'm using all the latest versions of Android Studio, the SDK and the emulator image.

What am I missing?

rnrneverdies
  • 13,347
  • 9
  • 57
  • 89
Boris
  • 7,424
  • 21
  • 59
  • 105
  • 1
    I'm having the same problem. I noticed that a subview does not allow for elevation. For example, a regular View with the background will show elevation. Wrapping it in something (for example purposes, a FrameLayout), it will not show the elevation. – ariets Nov 25 '14 at 16:09
  • 1
    This is kind of funny. Shadows below `View`s/`ViewGroup`s was one of the star features of the new Android 5.0 Material design and theme. But it's not working! Indeed the new CardView layout draws the shadows for API level 7-20, but not 21! – AxeEffect Nov 26 '14 at 13:55
  • @Boris is this view a Custom View? – rnrneverdies Dec 10 '14 at 00:49

1 Answers1

7

It looks like bug in Docs. Background with alpha doesn't drop shadow. Make the background color without alpha, and it will work. Related question: Elevation on Android Lollipop not working

Community
  • 1
  • 1
Pointer Null
  • 36,993
  • 13
  • 79
  • 106