进度条下载图像 [英] progress bar downloading image

查看:133
本文介绍了进度条下载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我希望以label.like显示下载图像的大小,5MB的2MB。

In my application i want to show the size of downloading image in label.like, 5 KB of 2MB .

进度条用于显示图像下载和我想显示当前正在下载图像以及下载完成大小的总大小(如,5 MB的2 MB)

Progress bar is used to show the image downloading and i want to show the total size of currently downloading image as well as completed size of downloading(like,5 KB of 2 MB)

任何人都可以给我指导。

Anyone give me guidance to do this.

为此我该怎么办? do.please给我任何示例代码或教程。

For this What should i do.please give me any sample code or tutorial for this.

已添加信息:

我已经在使用ASIHTTP库了。有几个委托方法。我想给出代码来查找下载图像的总大小和下载图像的进度。请给我一个代码来查找图像的大小(总大小和下载大小)。请帮助我.stil我不知道找到大小和使用哪种委托方法。

Already i'm using ASIHTTP Library .There are several delegate methods.In which method i want to give the code for finding the total size of the download image and progress of the downloding image.Please give me a code for findout the size of both (total size and downloaded size ) of an image.Please help me .stil i have no idea to find the size and which delegate method is used to support.

我真的很挣扎。请任何人指导我这样做。

推荐答案

由于你需要一些真正的代码,这里有一些提示。

Since you need some real code to start with, here are a few hints.


  • ASIHTTPRequest 包拖放到您的项目中。

  • 因为您想要的是从互联网上下载图像,您只需要在ASI中处理一个类包, ASIHTTPRequest 类。

  • 在开始之前仔细阅读 ASIHTTPRequest.h 文件。它具有您需要的所有界面。

  • 具体来说,请注意这两种方法,您必须覆盖它们才能获得实时下载统计信息。

  • Drag and drop the ASIHTTPRequest package into your project.
  • Since what you want is download images from the internet, you only need to deal with one class in the ASI package, the ASIHTTPRequest class.
  • Read the ASIHTTPRequest.h file closely before you start. It has every interface you need.
  • Specifically, pay attention to these two methods, you will have to override them to get real-time download statistics.

- (void)request:(ASIHTTPRequest *)request incrementDownloadSizeBy:(long long)newLength;
- (void)request:(ASIHTTPRequest *)request didReceiveBytes:(long long)bytes;

这篇关于进度条下载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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