这是设置装饰的代码: -
recyclerView.addItemDecoration(new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.HORIZONTAL));
这是xml: -
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<size android:height="1dp" />
<solid android:color="@android:color/black" />
</shape>
我尝试使用DividerItemDecoration.setDrawable(Drawable drawable)
设置drawable并在我的主题中设置android:listDivider
项目指向xml。
我也尝试将宽度设置为1dp。绝对没有用。
任何帮助表示赞赏,谢谢。