Extremely Laggy RecyclerView Performance

亡梦爱人 提交于 2019-12-01 16:46:43

I was having the same problem with RecyclerView. It was laggy. In my case, there was a horizontal list of image buttons inside RecyclerView.

I solved it by removing the scaleType from ImageButtons or ImageViews and loading images through Picasso with resizing like :

 Picasso.with(context).load(icon.get(position)).resize(270,270).centerCrop().into(holder.iconView);

The problem of lag may occur due to runtime scaling of big sized images or no. of images. It is not advisable. Whereas Picasso takes care of resizing, and loading efficiently. Also it handles caching for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!