I want something like this:
# android
y
I want something like this:
🧵 2
c
I would remove the last item from the list and not place it in the Lazy Row. Seeing as it doesnt need to be part of that row. Something like this:
Copy code
val stickyItem = allItems.last
            val scrollingItems = allItems.take(allItems.count() - 1)
            Row(modifier = Modifier.fillMaxWidth()) {
                LazyRow(modifier = Modifier.weight(1F)) {
                    items(scrollingItems) { item ->
                        RowItem(text = item)
                    }
                }
                RowItem(text = stickyItem)
            }
☝️ 1
y
Thanks. With a row it doesn’t work as I spect but if the container is a box it works well
c
can you elaborate more on what you mean by "it doesnt work" ? Im not using a box just a text and its working fine:
Copy code
val allItems = (1..20)
            val stickyItem = allItems.last
            val scrollingItems = allItems.take(allItems.count() - 1)
            Row(modifier = Modifier.fillMaxWidth()) {
                LazyRow(modifier = Modifier.weight(1F)) {
                    items(scrollingItems) { item ->
                        Text(text = "Item $item")
                    }
                }
                Text(text = "Item $stickyItem")
            }
y
Sorry, I didn't understand you well before. I've now tested the code, and it works fine. It was failing earlier because I was dynamically creating the Button Icons and had set the padding, etc., incorrectly. Thank you very much for the response.
🙌🏼 1
c
awesome, glad to have helped!