Hi. Can you please help me with this layout. I tri...
# compose
b
Hi. Can you please help me with this layout. I tried severl Lazy-Layouts but none is working as expected This is what i currently get but this does not fit my requirements. I want to have a horizontal list which has sections on top and below the sections you have the items for this section. so the sections on top have different length then the items in the sections. it can be longer or shorter. here is the code for achieving this, but i used a
LazyVerticalGrid
which scrolls from top to bottom. but i need it horizontally
Copy code
LazyVerticalGrid(
  columns = GridCells.Fixed(9),
  modifier = Modifier.background(Color.White)
) {
  items(items = listOf(
    "Section 1",
    "Section 2",
    "It 3",
    "It 4",
    "It 5",
    "It 6",
    "It 7",
    "It 8",
    "It 9"
  ),
    span = { item ->
      if (item == "Section 1") {
        GridItemSpan(5)
      } else if (item == "Section 2") {
        GridItemSpan(4)
      } else {
        GridItemSpan(1)
      }
    }) {
    Text(
      text = it,
    )
  }
}
Any ideas how to achieve this? Thx
d
If I understand what you are after, how about something like this (untested):
Copy code
LazyRow() {
    items( ... ) {
        Box() {
            Column() {
                Text()
                Row() {
                    for( ... ) {
                        Text()
                    }
                }
            }
        }
    }
}
e
There is a
LazyHorizontalGrid
?