将活动指示器与ASIHTTPrequest一起使用 [英] Use the activity indicator With ASIHTTPrequest

查看:94
本文介绍了将活动指示器与ASIHTTPrequest一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在异步模式下使用ASIHTTPRequest,我想显示一个活动指示器. 在他们的网站上,他们说:

i'm using ASIHTTPRequest in asynchrone mode and i want to show an Activity Indicator . In they website they say :

禁用对以下内容的自动更新 网络活动指示器(仅适用于iOS)

Disabling automatic updates to the network activity indicator (iOS only)

默认情况下,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 setShouldUpdateNetworkActivityIndi​​cator: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文档中有关于 查看全文

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