简体   繁体   中英

How to set a list of ImageView into a RecyclerView

I display my JSON data into a RecyclerView. I have multiple TextView into one item and it works perfectly.

In my data, I need to fetch photos and display them into each item. I have multiple photos for one item. It starts from 6 photos to... many more.

I tried using a RecyclerView inside my first RecyclerView but as you can guess it was a bad idea (bad performance, not the good result expected and so on).

Do you have any other solution or advice that might help, please?

I found a thousand solutions how to display one picture by row but none about multiple pictures into one row.

Create a custom view and add Image views dynamically based on no.of views required. Use this view in the recycler view adapter itemlayout file.

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