I'm having a lazyColumn
that wrap items of
@Composable
fun MySimpleListItem(
itemViewState: String,
itemClickedCallback: (() -> Unit)? = null,
) {
Card(
shape = RoundedCornerShape(50.dp),
backgroundColor = Color(0xFFFF0000),
) {
Text(
text = itemViewState,
modifier = Modifier.fillMaxWidth().padding(16.dp),
style = TextStyle(fontSize = 32.sp),
textAlign = TextAlign.Center
)
}
}
Looks like the corner at the top and bottom is rounded differently. Did I do anything wrong?
Your cards height is too small to display the shape correctly. It should be at least twice as large as your radius
Card(
modifier = Modifier.preferredHeight(100.dp),
shape = RoundedCornerShape(50.dp),
backgroundColor = Color(0xFFFF0000),
)
or set the radius of your shape in percent:
Card(
shape = RoundedCornerShape(50),
backgroundColor = Color(0xFFFF0000),
)
User contributions licensed under CC BY-SA 3.0