Android75
04/03/2022, 5:24 AMColumn(modifier = Modifier.fillMaxSize().padding(10.dp)) {
WPToolBar("Grid", textColor = Color.Blue, showBack = true)
Spacer16()
Row(
modifier = Modifier.fillMaxWidth().weight(1f)) {
Box(modifier = Modifier.weight(1f).fillMaxHeight()) {
CardCell()
}
Box(modifier = Modifier.weight(1f).fillMaxHeight()) {
CardCell()
}
}
Row(
modifier = Modifier.fillMaxWidth().weight(1f)) {
Box(modifier = Modifier.weight(1f).fillMaxHeight()) {
CardCell()
}
Box(modifier = Modifier.weight(1f).fillMaxHeight()) {
CardCell()
}
}
}
@Composable
fun CardCell() {
Card(elevation = 4.dp, shape = RoundedCornerShape(20.dp) ,modifier = Modifier.fillMaxSize().padding(10.dp)) {
Image(
contentScale = ContentScale.Fit,
contentDescription = null,
painter = painterResource(id = R.drawable.preview2)
)
}
}
nuhkoca
04/03/2022, 5:31 AMFillWidth
or Crop
for the contentScale
?Android75
04/03/2022, 5:33 AMnuhkoca
04/03/2022, 5:34 AMAndroid75
04/03/2022, 5:34 AMAndroid75
04/03/2022, 5:35 AMnuhkoca
04/03/2022, 5:36 AMChris Sinco [G]
04/04/2022, 12:01 AM