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 项包含一个图像视图和一个进度条)。当点击网格项目时,每个进度条都是可见的。
首先,加载图像显示在图像视图中,并通过使用下载的图像进行更新。
我的问题是,当用户点击图像正在加载图像的网格项目时(正在下载)
进度条变得可见。但是在调用notifyDataSetChanged() 更新图像时,进度条变得不可见。
即使图像已更新,我如何保持进度条的状态?
提前致谢。
notifyDataSetChanged()导致GridView重新加载。因此,您必须处理进度条是否在适配器的getView()方法中可见。
notifyDataSetChanged()
GridView
getView()