UIL, Picasso - Images in adapter always reload when stop scrolling

前端 未结 2 1727
野趣味
野趣味 2021-02-20 07:39

I have ListView with text and large image from internet. My image item has fit width and wrap_content height.
I tried to display image in background with

2条回答
  •  迷失自我
    2021-02-20 08:22

    If you're wondering how Facebook did it, they actually released their image loading library (https://github.com/facebook/fresco)

    Is it possible you are actually calling notifyDataSetChanged on the underlying ListView at that time? Also are you using hasStableIds()?

    For UIL you could try using a WeakMemoryCache (refer to https://github.com/nostra13/Android-Universal-Image-Loader/wiki/Useful-Info) as that'll theoretically allow you to make use of all available memory though it may cause a lot of extra GC calls.

    For Picasso Taha's method looks like your best bet!

提交回复
热议问题