我正在尝试使用 Jetpack Compose Coil 显示具有填充宽度和自动高度的图像。我希望图像采用完整宽度和自动高度。但图像仅在我指定固定高度时显示。
Image(
painter = rememberImagePainter(
data = post.image
),
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier.fillMaxWidth()
)
Run Code Online (Sandbox Code Playgroud)
我尝试使用.fillMaxHeight()and.fillMaxSize()但它不起作用。我有什么办法可以实现这个目标吗?