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

Archie

03/02/2021, 3:30 PM
Is there any way to add a
footer
to a
LazyColumn
so that if the items inside a
LazyColumn
doesn't consume all available space, the
footer
will be pinned at the bottom of the
LazyColumn
but if the items fill all the available space, the
footer
would act as a normal
LazyColumn
item?
On top of this, I was wondering if there is a way to make a
footer
sticky inside a
LazyColumn
.
a

Andrey Kulikov

03/02/2021, 3:34 PM
verticalArrangement param will help you to achieve this behaviour
and no, unfortunately there is no stickyFooter functionality
a

Archie

03/02/2021, 3:39 PM
Hi @Andrey Kulikov, Thank you very much. This means implementing my own
verticalArrangement
right?
a

Andrey Kulikov

03/02/2021, 3:53 PM
there is Arrangement.SpaceBetween, but it will work for you only if you have one item and a footer, but yes, it should be easy to write your own implementation
a

Archie

03/02/2021, 4:16 PM
yeah.
SpaceBetween
really limits the number of item inside the
LazyColumn
to a maximum of 2. So i guess creating a different implementation would be better.
13 Views