-
Notifications
You must be signed in to change notification settings - Fork 720
Open
Description
Describe the bug
I have a composable function which contains AsyncImage and some content (just Box here for simplicity) in a Row. Box should define height of whole Row, so I use intrinsic measurement here. This causes AsyncImage to look blurry. If I manually specify height of AsyncImage to match height of Box, image looks good, but it's not possible in my real layout (which is deeply nested).
To Reproduce
This function reproduces the bug:
@Composable
fun TestContent() {
Row(
modifier = Modifier
.fillMaxWidth()
.height(IntrinsicSize.Min),
) {
AsyncImage(
model = "https://img.cdn.level.travel/hotels/9067545/ea1882c778888d649bc9e44d1336d6e6.jpg",
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.width(64.dp)
.fillMaxHeight(),
)
Box(
modifier = Modifier
.weight(1f)
.height(120.dp)
.background(Color.Red),
)
}
}While this doesn't:
@Preview
@Composable
fun TestContent() {
Row(
modifier = Modifier
.fillMaxWidth(),
) {
AsyncImage(
model = "https://img.cdn.level.travel/hotels/9067545/ea1882c778888d649bc9e44d1336d6e6.jpg",
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.width(64.dp)
.height(120.dp), // manually copy height of Box to AsyncImage
)
Box(
modifier = Modifier
.weight(1f)
.height(120.dp)
.background(Color.Red),
)
}
}Version
I'm using Coil version 3.2.0 and Android Compose version 1.9.0-alpha02
Metadata
Metadata
Assignees
Labels
No labels