什么取代了重量?
What has replaced weights?
试图找出如何在最新版本中定位项目...许多在线示例指示使用 modifier = Modifier.weight(...)
,但在我使用的版本中根本没有给出该选项。
我需要在页面底部发送一个按钮,而不管它上面的惰性列的大小。做这种事情的首选方式是什么?
1.0.0-beta02
Modifier.weight
存在。
Size the element's height proportional to its weight relative to other weighted sibling elements in the Column
. The parent will divide the vertical space remaining after measuring unweighted child elements and distribute it according to this weight
类似于:
val itemsList = (0..60).toList()
Column {
LazyColumn(modifier = Modifier.weight(1f)){
items(itemsList) {
Text("Item is $it")
}
}
Row( verticalAlignment = Alignment.Bottom) {
Text(text = "Footer row")
}
}
否则你可以使用 ConstraintLayout
.
试图找出如何在最新版本中定位项目...许多在线示例指示使用 modifier = Modifier.weight(...)
,但在我使用的版本中根本没有给出该选项。
我需要在页面底部发送一个按钮,而不管它上面的惰性列的大小。做这种事情的首选方式是什么?
1.0.0-beta02
Modifier.weight
存在。
Size the element's height proportional to its weight relative to other weighted sibling elements in the
Column
. The parent will divide the vertical space remaining after measuring unweighted child elements and distribute it according to this weight
类似于:
val itemsList = (0..60).toList()
Column {
LazyColumn(modifier = Modifier.weight(1f)){
items(itemsList) {
Text("Item is $it")
}
}
Row( verticalAlignment = Alignment.Bottom) {
Text(text = "Footer row")
}
}
否则你可以使用 ConstraintLayout
.