recyclerView 中的重叠项目

发布于 2025-01-18 11:16:46 字数 394 浏览 3 评论 0原文

我有一个Recyclerview,其中显示了从上到下显示的项目列表。 我想了解与上一件重叠的最后一项。

我使用recyclerview.itemdemdecoration带有负面边距的几乎可以解决问题。项目视图确实重叠,但是当我处于列表的底部并且开始滚动时,重叠视图就会消失得太早。 在确定项目是否可见时,似乎根本没有考虑到Recyclerview。

有办法解决这个问题吗? 谢谢,

I have a RecyclerView with list of items displayed top to bottom.
I would like to have view of last item overlapping with the previous one.

I used RecyclerView.ItemDecoration with negative top margin and it almost does the trick. Item views indeed overlap, but when I'm at the bottom of the list and I start scrolling up then overlapping view disappears too early.
It looks like RecyclerView does not take into account the negative margin at all when deciding if item is visible or not.

Is there a way to fix that?
Thanks,

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文