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.
我有一个列表视图,一次将填充 3000 多个项目。每个项目都有一个图像视图,我必须从服务器获取其图像。我希望当用户滚动并完成时,listview 仅加载那些在屏幕上可见的视图的图像,并删除那些在屏幕上向上和向下滚动(不可见)的行的图像,以便可以重新下载它们的图像它们出现在屏幕上是因为由于内存限制,我无法保留所有数据的图像。
ListView 已经重用了不可见的视图,因此无需在之后删除它们,但您可以通过向列表添加滚动侦听器来优化这一点,并且仅在滚动停止时才下载图像。