LazyRow( modifier = Modifier .fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, state = state, flingBehavior = flingBehavior ) { itemsIndexed(images) { index, item -> AsyncImage( item, contentScale = ContentScale.Fit, contentDescription = "image", modifier = Modifier.fillMaxSize() ) } } 帮我i改成每一张图片都占满屏幕
时间: 2024-02-10 21:13:49 浏览: 152
Ajax Modifier-1.5.3.zip
你可以将 `AsyncImage` 的 `Modifier` 中的 `fillMaxSize()` 修改为 `fillMaxWidth().fillMaxHeight()`,这样每张图片就会占满整个屏幕。修改后的代码如下:
```
LazyRow(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
state = state,
flingBehavior = flingBehavior
) {
itemsIndexed(images) { index, item ->
AsyncImage(
item,
contentScale = ContentScale.Fit,
contentDescription = "image",
modifier = Modifier.fillMaxWidth().fillMaxHeight()
)
}
}
```
阅读全文