https://kotlinlang.org logo
#compose
Title
# compose
n

Nat Strangerweather

05/16/2022, 5:42 PM
Is there an obvious way to have a LazyGrid inside a LazyColumn? I have seen some workarounds but I was wondering what the preferred way is here on Slack.
c

Chris Fillmore

05/16/2022, 6:01 PM
Can you describe your use case a bit? I haven’t used LazyGrid yet, but I’m curious why you would want to put one inside a LazyColumn
I have a LazyGrid because my app is a word game. And basically the CenterAlignedTopAppBar uses a LazyColumn.
c

Chris Fillmore

05/16/2022, 6:13 PM
Do all the slots for letters/words fit on the screen?
Or is scrolling required? Follow up: Is the number of slots fixed
n

Nat Strangerweather

05/16/2022, 6:15 PM
yes it all fits, I just wondered if it was possible to put it in a LazyColumn.
Take it more as me being curious.
c

Chris Fillmore

05/16/2022, 6:18 PM
Ok for curiousity’s sake… I don’t really know 🙂 Having said that, based on what you described, I don’t think you need LazyColumn or LazyGrid, since everything is on screen and the number of cells is presumably fixed. You can just define
Row
and
Column
😊 1
3 Views