Does Glide queue up every image request? Recyclerview loads are very slow when scrolling

前端 未结 1 1278
眼角桃花
眼角桃花 2021-02-15 17:58

I have been seeing very long load times for images in our app using Glide 3.6 + a RecyclerView using a GridLayoutManager. The images are all around 20kb-40kb. It seems that glid

相关标签:
1条回答
  • 2021-02-15 18:55

    Add following lines and you will see the improvement

    recyclerView.setHasFixedSize(true);
    yourAdapter.setHasStableIds(true);//recycler adapter
    

    override onViewRecycled() & clear previous Glide request

    Glide.with(imageHolder.preview.getContext()).clear(imageHolder.preview);
    
    0 讨论(0)
提交回复
热议问题