How can I draw a background around just a couple o...
# compose
e
How can I draw a background around just a couple of items in a
Column
? Like my entire column content was divided into sections and I want to draw a bg behind some of those children
c
I think I asked this a while back when i wanted to just draw a card around a subset of items in a lazyCol and it seemed like it was not possible. Seemed like I had two choices 1. take the subset of items and just actually make that 1 item 2. just "fake" it by drawing a card myself I think it was Sergey Vasilinets that helped me
m
I did this for LazyColumn. You have item position information in LazyListState, and then i draw with a LazyList modifier drawBehind. Don’t know for column tho, as the item position is not known by the parent
e
@Colton Idle can you link your own question, I’d like to know what @Sergey Vasilinets thought. @myanmarking yeah i’m using column and not lazy column this time 😞
c
on mobile. but if you search my name and sergeys name and lazycolumn it should be like one of the only hits. if not i will try to find it later.
z
If you only need to do this with a non-lazy column, you could group your items inside columns within the overall column and pass border modifiers to the subcolumns. That won't work for lazy columns though.