Код: Выделить всё
Card(
modifier = modifier
.fillMaxWidth()
.height(74.dp),
shape = RoundedCornerShape(12.dp),
elevation = elevation
) {
Row(
modifier = Modifier
.fillMaxSize()
.background(backgroundColor)
) {
Box(
modifier = Modifier
.fillMaxHeight() // Ensure it takes up full height
.weight(0.25f) // Take 25% of the width
) {
AsyncImage(
model = imageUri,
contentScale = ContentScale.FillBounds, // Ensures the image crops to fill bounds
contentDescription = imageContentDescription,
placeholder = painterResource(R.drawable.img),
modifier = Modifier
.fillMaxSize() // Fills the Box completely
)
}
Text(
text = descriptionText,
color = textColor,
fontSize = FontSize.Medium,
fontWeight = FontWeight.Medium,
maxLines = 3,
overflow = TextOverflow.Ellipsis,
modifier = Modifier
.padding(horizontal = Dimensions.Medium)
.align(Alignment.CenterVertically)
.weight(0.75f)
)
}
}

Почему в приведенном выше коде добавляются отступы в левом верхнем и нижнем левом углу, из-за чего изображение не полностью заполняет эти области?
Я пробовал настроить contentScale, но это не помогло сработало.
Даже переключился на упаковку AsyncImage в блок
Подробнее здесь: https://stackoverflow.com/questions/790 ... ft-corners