如何更新GridView的项目在安卓 [英] How to update GridView Items in Android

查看:121
本文介绍了如何更新GridView的项目在安卓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的ImageView和进度作为一个GridView的每个子项(每个GridView的项目包含一个ImageView的和进度),其中进度条是隐藏的。每个进度是可见的,当自来水并网项目。

I am using an imageview and a progressbar as each child items of a gridview(Each GridView item contains an imageview and a progressbar) where progressbar is hidden. Each progressbar is visible when tap on grid item.

目前第一装载图像显示在imageview的和被更新通过使用下载的图像。

At first a loading image is shown in the imageview and it is updated by using downloaded images.

我的问题是,当电网项目,其中图像加载图像的用户水龙头(下载正在进行中)

My problem is, when the user tap on grid item where image is loading image(Downloading is in progress)

在调用时进度成为visible.But的进度成为无形的 notifyDataSetChanged()以更新的形象。

the progressbar become visible.But the progressbar become invisible when invoking notifyDataSetChanged() to update the image.

我怎样才能保持进度,即使图像中更新的状态?

在此先感谢。

推荐答案

notifyDataSetChanged()会导致gridview的重新装载。所以,你必须处理如果进度条是在您的适配器的getView()方法可见。

notifyDataSetChanged() causes the gridview to be reloaded. So you have to handle if the progress bar to be visible in your adapter's getView() method.

这篇关于如何更新GridView的项目在安卓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆