将活动指示器与 ASIHTTPrequest 一起使用
我在异步模式下使用 ASIHTTPRequest ,我想显示一个 Activity Indicator 。 在他们的网站上他们说:
禁用自动更新 网络活动指示器(仅限 iOS)
默认情况下,ASIHTTPRequests 将显示 网络活动指示器(在 iOS 设备上的状态栏) 请求正在使用网络。如果你 你更喜欢自己管理这个 可以禁用这些更新:
[ASIHTTP请求 setShouldUpdateNetworkActivityIndicator:NO];
但我不想在状态栏中显示它,我在我的应用程序中禁用了状态栏。我想在我的界面中显示它。有人有想法吗?
编辑:@alex Reynolds,我阅读并尝试了它,但我的进度条仍然是白色的,完成后他直接变成蓝色,他没有进度。请注意,下载需要 10 秒。他仍然变白10秒,然后变成蓝色。这是我的代码
NSURL *url =[NSURL URLWithString:myURLString];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadProgressDelegate:myProgressView];
[request setDelegate:self];
[request startAsynchronous];
myProgressView 是 UIProgressView
i'm using ASIHTTPRequest in asynchrone mode and i want to show an Activity Indicator .
In they website they say :
Disabling automatic updates to the
network activity indicator (iOS only)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];
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 ?
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 is UIProgressView
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASIHTTPRequest
文档中有一个关于跟踪进度 请求数。The
ASIHTTPRequest
documentation has a section on tracking progress of requests.