How to add dividers and spaces between items in RecyclerView?

前端 未结 30 2882
清歌不尽
清歌不尽 2020-11-22 03:27

This is an example of how it could have been done previously in the ListView class, using the divider and dividerHeight parame

30条回答
  •  再見小時候
    2020-11-22 04:23

    The simple one is to set background color for RecyclerView and different background color for items. Here is an example ...

    
    

    and the TextView item (It can be anything though) with bottom margin "x" dp or px.

    
    

    The output ...

    enter image description here

提交回复
热议问题