I'm trying to draw this shadow below list header, to give an illusion of LazyColumn
items scrolling below (or behind) the header:
I tried:
Modifier.shadow()
but it does not yield desired result.Box
with gradient background, which does what I want, but get overdrawn with LazyColumn
elements.To counter this drawing over my gradient I tried the following:
Box
after LazyColumn
,Modifier.zIndex(10f)
to Box
.Of course, none of that worked. Immediately after LazyColumn
elements were drawn, gradient disappeared.
What am I missing?
Have you tried a Surface with elevation?
From docs https://developer.android.com/jetpack/compose/designsystems/material#elevation-overlays
Surface(
elevation = 2.dp,
color = MaterialTheme.colors.surface, // color will be adjusted for elevation
/*...*/
) {
// TODO - Put your list header here.
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With