RecyclerView laggy scrolling

后端 未结 13 777
闹比i
闹比i 2020-12-09 09:44

I am loading 400x200 images in RecyclerView, but scrolling is laggy on 2k devices. I am using Picasso for loading images from resource.

As you can see in the demo ima

13条回答
  •  -上瘾入骨i
    2020-12-09 10:23

    from my experience with recyclerview what i found the possible cause could be is the image size. beside that adding property ( setNestedScrollingEnabled(false); ) to the recyclerview and ( setHasStableIds) to the adapter does help to make recyclerview work smoothly. So, bottom line is, if your recyclerview has image to load from network make sure to override their size or use thumbnail property(in glide). this tricked saved my life and i hope it might save others life as well. Happy coding :)

提交回复
热议问题