作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为 Android 应用程序开发一个无限滚动列表,使用 RecyclerView
View 组和一个 OnScrollListener
在用户滚动到最后一个项目后添加项目RecyclerView
的。
现在想在项目后面的中间添加一条黑线,作为一种回收 View 。
如您所见,项目可以有不同的高度。
实现此目标的最佳(也是最高效)方法是什么?
最佳答案
您可以考虑使用如下布局。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/your_background">
<android.support.v7.widget.RecyclerView
android:id="@+id/your_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" />
</RelativeLayout>
关于android - 如何为无限滚动的 RecyclerView 绘制背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49964375/
我是一名优秀的程序员,十分优秀!