Hello, does anyone know how can i slightly overlap...
# compose
f
Hello, does anyone know how can i slightly overlap the first two items of a list in compose? The first item will actually be an image configured as collapsable and act as a toolbar, while the second one will be the "beginning of the view". I know i can put two items in a box to overlap them, but since here they belong to a LazyColumn, i don't know how can i do it
m
what about setting LazyColumn's
verticalArrangment
parameter to
Arrangement.spacedBy((-value).dp)
? replace
value
with whichever number and adjust that number until you get the exact overlapping ratio you want
j
wouldn't that overlap all items in the
LazyColumn
? I'd rather use the
.offset()
modifier on the second item
m
This might be a good solution too! actually, I've assumed that the lazy column contains only those two items (the image, and the view)
f
Yes, that was my issue using the spacedBy solution, it would affect all of the items. I will try the offset, thanks for the help guys ! 🙂
Hello just for future reference for anyone reading this here, by shifting this view upwards (or downwards) it will affect the original spacing for the other elements on the list.
m
I guess making a custom Arrangment.Vertical would exactly do the trick here for you, take a look at this approach and the
arrange
fun that you would override