I am not getting any elevation or shadow for this:...
# compose
z
I am not getting any elevation or shadow for this:
Copy code
Surface(
                elevation = 16.dp
            ) {
                Text(text = "Hello World", modifier = Modifier.padding(16.dp))
            }
But if I add
Modifier.drawLayer(shadowElevation = 16f
then I get shadow. Now my qs is. shouldn’t elevation give us the shadow/elevation?
a
maybe you wrapped your Surface into some other Surface of the same size so this parent Surface clipped the shadow produced by an inner one? could you share more code?
z
thanks. it was due to clipping.