如何在IOS SDK中显示图像的加载进度条

时间:2013-10-29 11:16:18

标签: ios iphone image-processing uiimageview uiprogressview

我正在创建一个图书阅读器应用程序。在我的应用程序中,我将页面加载为来自Web URL的图像。当加载每个图像时,我想显示加载百分比,如下面的enter image description here

请建议我一些想法

3 个答案:

答案 0 :(得分:2)

答案 1 :(得分:2)

我已经制作了一个非常可定制的开源进度视图,并且在即将发布的2.0版本中会更加如此。您可以在lightdesign/LDProgressView找到它。如果它符合您的需求或如何更改,请告知我们。

答案 2 :(得分:1)

看看NSURLConnectionDataDelegate(NSURLConnection的协议)。 https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLConnectionDataDelegate_protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDataDelegate

您需要实施以下方法:

(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite

为了支持这种行为。

相关问题