In common compose layout, multiple children may overlap just like they are in a Box
(like flutter Stack
). When I try to put multiple children into a LazyColumn
or LazyRow
‘ s item
block, they are positioned in order and are not overlapped. What special thing does LazyItemScope
do? Does it put all its children into a Column or a Row?
@Composable
fun A() {}
@Composable
fun B() {}
@Composable
fun Container1() { // content: @Composable () -> Unit
A()
B()
}
@Composable
fun Container2() {
LazyColumn { // or LazyRow
item { // content: @Composable() (LazyItemScope.() -> Unit)
A()
B()
}
}
}