alf*_*tap 42 android android-jetpack-compose
我希望有一个最初包裹内容高度的 LazyColumn,但如果它达到一定高度(232dp),那么它会修复它的高度。在 XML 中,我会结合使用 maxHeight 和wrappContent,但我在 Compose 中找不到类似的东西?
Age*_*ntP 93
您可以像这样使用heightIn
修饰符LazyColumn
LazyColumn(
modifier = Modifier
.heightIn(0.dp, 232.dp) //mention max height here
.widthIn(0.dp, 232.dp) //mention max width here
) {
}
Run Code Online (Sandbox Code Playgroud)
这将确保如果添加更多项目,高度不会超过 232.dplazycolumn
归档时间: |
|
查看次数: |
26914 次 |
最近记录: |