Hi. I have a Column with some `Surfaces` on it, f...
# compose
a
Hi. I have a Column with some
Surfaces
on it, first of them has an elevation of
8.dp
, however the shadow is not displayed. If i add some bottom padding to the Surface, then it shows... but... why is that? shouldn't shadow draw over other elements?
a
Drawing order depends on z index and composing order. Shadows don't have any privileges.
a
Uhmm, so how do I show shadow on first surface? (the blueish content)
basically i have:
Copy code
column {
 surface(blueish, elevation=8.dp)
 surface
 surface
 surface
}
a
You can add
Modifier.zIndex(1f)
to the first surface.
a
Uhm, let me check
Cool! it works! Not sure what was the cause... not understand much about it
a
The doc of
Modifier.zIndex()
explains it.
A child with larger zIndex will be drawn on top of all the children with smaller zIndex. When children have the same zIndex the original order in which the parent placed the children is used.
a
thanks