【问题标题】:Recyclerview footer at bottom of screen when no scroll AND at end of the list when it has scroll没有滚动时屏幕底部的 Recyclerview 页脚和滚动时位于列表末尾的 Recyclerview 页脚
【发布时间】:2016-08-21 14:30:37
【问题描述】:

在我的应用程序中,我在所有屏幕(对于有滚动的屏幕)的滚动末尾都有品牌页脚,并且在屏幕底部有静态(无滚动)。

但是我在使用具有列表的屏幕来实现这一点时遇到了问题。我正在使用 recyclerview 来显示列表。我想在 recyclerview 滚动时显示 Branding Footer 在它的末尾 并且 它在底部滚动时可见。 这可以通过带有页脚的 Recyclerview 实现。

但是当 recyclerview 没有滚动时(当列表中的项目很少时),我希望页脚固定在屏幕底部。

提前致谢!

【问题讨论】:

标签: android android-recyclerview footer


【解决方案1】:

这个问题看起来与其他几个问题相似,与此问题相关的大多数堆栈溢出帖子都指向使用 itemdecoration 来实现这一点(通过添加所需高度的 itemdecoration)

实现此目的的一种方法是预先确定回收站视图的高度,然后使用该信息设置与回收站视图关联的 itemdecoration 中的页脚偏移量

这可能会有所帮助:How implement sticky footer in recyclerview

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-26
    • 1970-01-01
    • 2018-09-12
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    相关资源
    最近更新 更多