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

efemoney

08/22/2022, 8:23 AM
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

Colton Idle

08/22/2022, 10:11 AM
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

myanmarking

08/22/2022, 10:38 AM
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

efemoney

08/22/2022, 11:57 AM
@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

Colton Idle

08/22/2022, 12:12 PM
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

Zach Klippenstein (he/him) [MOD]

08/22/2022, 1:12 PM
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.
4 Views