-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Description
Glide Compose ContentScale.FillWidth not work as expected。There will be white space at the bottom and top. The image in the example below is only displayed once.
private val reusableModifier = Modifier
.fillMaxWidth()
.sizeIn(minHeight = 50.dp)
@OptIn(ExperimentalGlideComposeApi::class)
@Composable
fun TestScreen(uri: String="https://images.pexels.com/photos/17850755/pexels-photo-17850755.jpeg"){
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.Top
) {
com.bumptech.glide.integration.compose.GlideImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
com.bumptech.glide.integration.compose.GlideImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
}
}
The following is a comparison between coil.compose.AsyncImage and com.bumptech.glide.integration.compose.GlideImage
private val reusableModifier = Modifier
.fillMaxWidth()
.sizeIn(minHeight = 50.dp)
@OptIn(ExperimentalGlideComposeApi::class)
@Composable
fun TestScreen(uri: String="https://images.pexels.com/photos/17850755/pexels-photo-17850755.jpeg"){
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.Top
) {
coil.compose.AsyncImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
coil.compose.AsyncImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
com.bumptech.glide.integration.compose.GlideImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
com.bumptech.glide.integration.compose.GlideImage(
model = uri,
contentScale = ContentScale.FillWidth,
contentDescription = "",
modifier = reusableModifier
)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

