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

Alex

12/07/2021, 2:46 PM
Is it possible to define a z-Index for LazyColumns items? The usecase is a draggable list item that should be drawn on top of all other list items so it wont disappear behind list items below it while it is being dragged
s

sindrenm

12/07/2021, 3:02 PM
You can change the z-index with
Modifier.zIndex
, at least. 👍
a

Andrei Kovalev

12/08/2021, 11:38 AM
a

Alex

12/08/2021, 3:55 PM
@sindrenm this won't work in LazyColumns though, would it? Since it only affects composables that share a parent. I had no luck at least, but maybe I am doing something wrong. Wouldn't know what though @Andrei Kovalev thanks, I'll check it out!
a

Andrei Kovalev

12/08/2021, 3:57 PM
@Alex I had to come up with custom LazyGrid solution which was basically the copy of LazyGrid + workaround with zIndex which was passed via local compisition
s

sindrenm

12/08/2021, 4:10 PM
Oh, my bad. I wasn't aware that
zIndex
only worked for composables sharing the same parent.
5 Views