I've created the simple card in jetpack compose, Here I set elevation but it shows a type mismatch.
Card(
shape = RoundedCornerShape(20.dp),elevation = 10.dp
) {
Box(modifier = Modifier.height(200.dp)) {
Image(painter = painter, contentDescription = contentDescription,
contentScale = ContentScale.Crop)
}
}
You are using M3 (
androidx.compose.material3
)Card
and theelevation
attribute requires aCardElevation
object:Something like: