在我的recyclerview中,项目之间紧贴在一起,我想在项目之间添加间距,但不想在项目本身中添加边距。我想知道如何实现这一点?目前它看起来像这样:
我希望它看起来像这样:
我能否编辑XML本身来实现这一点?
![enter image description here](https://istack.dev59.com/PCIWX.webp)
![enter image description here](https://istack.dev59.com/GqqOF.webp)
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:background="@color/gray6"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animationCache="false"
android:cacheColorHint="@color/transparent"
android:descendantFocusability="afterDescendants"
android:divider="@color/transparent"
android:dividerHeight="0dp"
android:listSelector="@color/transparent"
android:scrollingCache="false" />