How to add dividers and spaces between items in RecyclerView?

前端 未结 30 3357
清歌不尽
清歌不尽 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:15

    If you want to add same space for items, the simplest way is to add top+left padding for RecycleView and right+bottom margins to card items.

    dimens.xml

    
        1dp
    
    

    list_item.xml

    
     ...
    
    

    list.xml

    
    

提交回复
热议问题