Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add headers/titles for cards in a recyclerview?

I have a short question. How is it possible to make headers for groups on cards on a recyclerview like of the image below.

enter image description here

Thanks a lot for answers

like image 646
Johannes Avatar asked Jan 12 '17 16:01

Johannes


1 Answers

You need to set another type of ViewHolder in the RecyclerView, and override the method getItemViewType to select which ones you need to paint. You can learn more about this in How to create RecyclerView with multiple view type?

like image 147
Alvaro Avatar answered Sep 18 '22 11:09

Alvaro