The recyclerview footer is at the bottom of the screen when there is no scroll And at the end of the list when it has scroll

In my application, I have a footer at the end of scrolling on all screens (for scrolling screens) and static at the bottom of the screen when (no scrolling).

But I ran into problems to achieve this using a screen that has a list. I use recyclerview to display a list. I want to show the Branding Footer at the end of the recyclerview when it has a scroll and it will be visible when it scrolls below. This can be done using Recyclerview with a footer.

footer at the end of recyclerview

But when the recyclerview has no scroll (when multiple items are in the list), I want the footer to be set to the bottom of the screen.

footer when fewer elements are static below

Thanks in advance!

+4
android footer android-recyclerview
source share
1 answer

The question seems similar to a few others, most posts related to this question point to the use of itemdecoration to achieve this (adding itemdecoration to the desired height)

One way to achieve this would be to predefine the height of the resizer view, and then use this information to set the offset for the footer in the itemdecoration associated with the rewrite view

This may help: How to implement a sticky footer in recyclerview

0
source share

All Articles