远程图像下载有进度吗?
我想添加从互联网下载图像到 imageview 的功能,当 ImageView 加载时,它应该在 ListView 中显示 ProgressBar
我已经看到了 droid fu 的示例,这是非常困难且难以理解的,如果有人实现了这样的功能,任何人都会指导我以及如何实现这一目标,任何带有示例的指导将不胜感激。
I want to add functionality to download image into imageview from internet and while ImageView is loading it should show ProgressBar in ListView
I have seen example of droid fu which is very difficult and hard to understand any one guide me if any one has implemented functionality like this and how to achieve this any guidance with example would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要调用:
现在,要下载您调用的图像:
这将触发图像下载并显示进度条(您的进度条应与 imageView 一起位于框架布局中)。
要捕获图像下载完成的事件并释放进度条,您应该扩展 ImageLoaderHandler 类并重写 handleImageLoaded ,如下所示(您必须调用 super 以便让 droidFu 处理缓存)。
First you need to call:
Now, to download an Image you call:
This will triger the image download and show the progress bar (your progress bar should be in a frame layout along with the imageView).
To catch the event of done downloading the image and release the progressbar you should extend the class ImageLoaderHandler and override handleImageLoaded as follow (you have to call super in order to let droidFu handle the cach).