简体   繁体   中英

Nested RecyclerView's height to “wrap_content” with a large amount of items

I have a RecyclerView nested in a vertical scrolling view. The RecyclerView displays items with a vertical LinearLayoutManager . Its height is (and has to be, per product specification) set to wrap_content .

Problem is memory and performance issues come around quickly when I set a large amount (~50+) because items are simply not recycled.

What is the good way to make this work nicely and smoothly?

Edit: Ok, some more details.

I have to make screen that describes a TV show: the synopsis, the list of seasons, and for each season the list of episodes. The list of episodes for each season must not be collapsed/folded/shrinked.

This is what I have to achieve:

在此处输入图片说明

The problem is, that you have a scrolling view inside a scrolling view. Apply recyclerView.setNestedScrollingEnabled(false) to your 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