How to center items of a recyclerview?

前端 未结 8 1741
夕颜
夕颜 2020-12-14 14:38

I need to center elements in each row so they will be like in this mockup. I\'ve been searching if there is any layout that works that way without look. items are centered i

8条回答
  •  攒了一身酷
    2020-12-14 15:16

    I am assuming that you are using a LinearLayoutManager with a RecyclerView for a ListView-style effect. In that case, use a horizontal LinearLayout for each row, with android:gravity="center" to center its contents.

提交回复
热议问题