https://kotlinlang.org logo
#compose
Title
# compose
z

zoha131

10/19/2020, 3:45 PM
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

Andrey Kulikov

10/19/2020, 6:14 PM
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

zoha131

10/19/2020, 6:26 PM
thanks. it was due to clipping.
2 Views