What's the relationship between `elevation` and `...
# compose
m
What's the relationship between
elevation
and
zIndex
? They seem to affect each other, but I am not sure how exactly.
f
elevation
in the material design refers to the theoretical elevation of the element and the resulting shadow. The
zIndex
should be purely the draw order in a scope.
From
shadow()
modifier documentation:
Note that elevation is only affecting the shadow size and doesn't change the drawing order. Use a androidx.compose.ui.zIndex modifier if you want to draw the elements with larger elevation after all the elements with a smaller one.