zoukankan      html  css  js  c++  java
  • 进度的Block在子线程调用

    [_pictureView sd_setImageWithURL:[NSURL URLWithString:item.image2] placeholderImage:nil options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {

        

        //        NSLog(@"%ld %ld",receivedSize,expectedSize);

        if (expectedSize == -1) return ;

        

        CGFloat progress = 1.0 * receivedSize / expectedSize;

        

        NSString *str = [NSString stringWithFormat:@"%.0f%%",progress * 100];

        

        dispatch_sync(dispatch_get_main_queue(), ^{

            _progressView.progressLabel.text = str;

            

            _progressView.progress = progress;

        });

        

    } completed:nil];

     

    完事皆项目,感兴趣可联系我邮箱~hjjuny@163.com
  • 相关阅读:
    多窗体
    滚动条
    个人信息调查
    登录页面
    蓝桥杯——放麦子
    java的BigDecimal
    蓝桥杯——判定字符的位置。
    输出日历
    蓝桥杯---简单的计算器
    蓝桥杯--Quadratic Equation
  • 原文地址:https://www.cnblogs.com/hjjun/p/6001543.html
Copyright © 2011-2022 走看看