问题描述
我正在异步模式下使用ASIHTTPRequest,我想显示一个活动指示器.在他们的网站上,他们说:
i'm using ASIHTTPRequest in asynchrone mode and i want to show an Activity Indicator .In they website they say :
默认情况下,ASIHTTPRequests将显示 网络活动指示器(在 状态栏) 请求正在使用网络.如果你 宁愿自己管理这个,你 可以禁用这些更新:
By default, ASIHTTPRequests will show the network activity indicator (in the status bar) on iOS devices when requests are using the network. If you prefer to manage this yourself, you can disable these updates:
[ASIHTTPRequest setShouldUpdateNetworkActivityIndicator:NO];
[ASIHTTPRequest setShouldUpdateNetworkActivityIndicator:NO];
但是我不想在状态栏上显示它,我在我的应用程序中禁用了状态栏.我想在界面中显示它.有人有主意吗?
But i dont wan't to show it in statuts bar , i disabled the statuts bar in my app . I want to show it in my interface . Some one have an idea ?
@alex Reynolds,我阅读并尝试了一下,但是进度条仍然空白,完成后他直接变成蓝色,他没有进度.请注意,下载需要10秒.他仍然过十秒钟,然后变蓝.这是我的代码
Edit : @alex Reynolds, i read and trie it but my progress bar Still blanc and when finished he become blue directly , he don't progresse .Note that the download take 10 seconde . He still blanc 10 second and then become blue . this is my code
NSURL *url =[NSURL URLWithString:myURLString];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadProgressDelegate:myProgressView];
[request setDelegate:self];
[request startAsynchronous];
myProgressView是UIProgressView
myProgressView is UIProgressView
推荐答案
ASIHTTPRequest
文档中有关于跟踪请求的进度.
这篇关于将活动指示器与ASIHTTPrequest一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!