Recyclerview footer at bottom of screen when no scroll AND at end of the list when it has scroll

主宰稳场 提交于 2019-12-05 00:45:28

问题


In my application I have branding footer at the end of scroll on all screens (for screens which have scroll) and static at bottom of the screen when(no scroll).

But I am facing issues to achieve this with screen which has list. I am using recyclerview for showing list. I want to show Branding Footer at end of the recyclerview when it has scroll and it will be visible when it is scrolled at the bottom. This is achievable with Recyclerview with footer.

But when recyclerview does not have scroll (when few items in list), I want footer fixed at bottom of the screen.

Thanks in advance!


回答1:


The question appears similar to several other, most of the stack overflow posts related to this question point towards the usage of itemdecoration to achieve this (By adding itemdecoration of the desired height)

One way of achieving this would be to determine the height of the recycler view beforehand and then using that information to set the offset for the footer in the itemdecoration associated with the recycle view

This might help: How implement sticky footer in recyclerview



来源:https://stackoverflow.com/questions/36887339/recyclerview-footer-at-bottom-of-screen-when-no-scroll-and-at-end-of-the-list-wh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!