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

nuhkoca

04/18/2022, 1:55 AM
Hello, I have a page with a custom
TopBar
mimic(it is not a Scaffold
TopBar
, rather just a
Box
due to transparency) and I need to use a sticky header in my
LazyColumn
but the header doesn’t stick to custom
Box(TopBar mimic)
as it probably doesn’t treat it as a
TopBar
. How do I manage to have a sticky header with a custom mimic?
z

Zach Klippenstein (he/him) [MOD]

04/18/2022, 4:32 PM
The easiest solution would be to put your top bar and your list in a Column instead of a Box, since it doesn’t look like the top bar is translucent here. Otherwise, i’m not sure, i’ll ask around.
n

nuhkoca

04/18/2022, 4:49 PM
Hey Zach, thanks for the reply! Would it really work? I draw content behind topbar and status bar actually. Will try your suggestion anyway
z

Zach Klippenstein (he/him) [MOD]

04/19/2022, 2:31 PM
I think you could use the contentPadding parameter to
LazyColumn
for this? Just from reading the kdoc it looks like it should do it.
n

nuhkoca

04/20/2022, 2:32 PM
Naah, everything you see on the screen is in a LazyColumn
z

Zach Klippenstein (he/him) [MOD]

04/21/2022, 4:54 PM
Oh sorry, I thought the top bar was outside the column and you were trying to get sticky headers inside the column to stay below it.
n

nuhkoca

04/21/2022, 7:23 PM
Yes top bar outside the lazy list but I draw content behind top bar and status bar as you see. So wouldn’t it look ugly if I set top padding to lazy column?
Everything starting from Image to description text placed into LazyColumn
Tried but not working, actually I need this padding for sticky header only, not for the whole list
4 Views