Anum Amin
07/07/2025, 8:22 PMshadow
modifier doesn't render properly if parent composable is a Surface
? If it is under Box
, it is rendered correctly. Couldn't find in the documentation. In the attached screenshots, notice the sharp edge if parent is Surface
. TIA
Snippet in 🧵Anum Amin
07/07/2025, 8:23 PMSurface( //Or Box
modifier = Modifier
.background(Color.White.copy(alpha = 0.2f))
.padding(50.dp)
) {
val shape = RoundedCornerShape(8.dp)
val backgroundColor = Color.Yellow
Row(
modifier = Modifier
.shadow(
color = Color.Red.copy(alpha = 0.12f),
offsetY = 4.dp, blurRadius = 8.dp, spread = 4.dp
)
.clip(shape)
.background(
color = backgroundColor,
shape = shape
)
.border(
width = 1.dp,
color = Color.Red,
shape = shape
)
) {
//Text content
}
}
Sergey Y.
07/07/2025, 8:38 PM