版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a695929533/article/details/51155942
网上有很多关于recyclerview的分割线实现的方法,我也找了很长时间,大多都是要自己写一个类,画线什么的。
这里介绍给大家一个极其简单的实现的方法。
在item的模板文件根视图的最下面,加上这么一段
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/recyclerView_cellBottom"
>1</LinearLayout>
color的颜色随便
layout_width:一定要match_parent
layout_height等于1px
轻松实现