简体   繁体   中英

List in recyclerview item

How to in recycler-view create a list of events dependent on the day, week, month etc? I need a recycler-view with items divided by date and in every single item has some number of events. But how to create item that will match the number of events? For example: if I have only one event the item shows only one event, but if there is more item shows more. Something like the attached picture: enter image description here

this and this are very good examples to start with. Here is the android documentation

You can use a Recycler View nested inside another Recycler View. The outer adapter will populate items which have different date and inner adapter will populate inner recycler view with number of events in that date. Give it a try. If problem arises, comment.

您可以使用嵌套的recyclerview,但是请记住,您可能会遇到一些布局问题。有关recyclerview性能优化的主题很多。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM