【问题标题】:Downloading Status and progress bar not display下载状态和进度条不显示
【发布时间】:2013-10-14 06:35:36
【问题描述】:

我正在一个单元格中使用 ASIHTTP 库下载多个文件,并显示多个进度和状态,如接收到的字节等发生在 ASIHTTPRequest 的响应块中。请帮帮我

提前致谢

【问题讨论】:

    标签: uitableview asihttprequest download download-manager


    【解决方案1】:

    您只需导入所有 ASIHTTPRequest 库,当您使用进度条并使用下面的内置方法时,您需要使用协议文件导入...

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        NSString *url=@"http://dulemba.com/Visits/Cover-GGCC(2mb).jpg";
    
        proTo = [[protocol_file alloc]initWithURL:[NSURL URLWithString:url] delegate:self];
    
    
    
    
        imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 10, 300, 250)];
        [self.view addSubview:imageView];
        lbl=[[UILabel alloc]initWithFrame:CGRectMake(0, 250, 200, 100)];
        [self.view addSubview:lbl];
        lblPers=[[UILabel alloc]initWithFrame:CGRectMake(100, 250, 200, 100)];
        [self.view addSubview:lblPers];
        progressBar = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 280, 300, 90)];
        [self.view addSubview:progressBar];
    
    
    
      }
    
    -(void)imgDownload:(UIImage *)data{
         imageView.image=data;
       NSLog(@"image");}
    -(void)setLblvalue:(float)val{
         lblPers.text=[[NSString alloc]initWithFormat:@"%0.2f %%",val];
         }
    -(void)setProgValu:(float)val{
     progressBar.progress=val;
    

    // NSLog(@"progress %f",val); }

    -(void)setPersent:(float)val{
         lbl.text = [[NSString alloc] initWithFormat:@"%0.2f MB",val];
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-26
      • 2017-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-19
      • 2016-07-30
      相关资源
      最近更新 更多