Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前有一个显示一些缩略图的gridview。我遇到的问题是,当我滚动浏览图像时,我可以看到图像在被替换时从旧图像切换到新图像。所以,我想知道如何解决这个问题。有没有办法加载不在屏幕上的图像,所以当我滚动时用户不必看到图像的变化?
避免这种影响的最好方法是首先null在getView()适配器的方法中设置图像。然后,如果图像已经加载,您可以检查 LRU 缓存。如果是,则立即设置它,如果不是,则将其作为位图异步加载。将其设置为视图并将其添加到 LRU 缓存中。
null
getView()