SDWebImage加进度条展示图片下载进度
来源:互联网 发布:.cx域名投资 编辑:程序博客网 时间:2024/06/05 00:40
#import "ViewController.h"#import "UIImageView+WebCache.h"@interface ViewController ()@property (nonatomic,strong) UIImageView *imv;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; self.imv = [[UIImageView alloc]initWithFrame:self.view.bounds]; [self.view addSubview:self.imv]; __block UIProgressView *pv; [self.imv sd_setImageWithURL:[NSURL URLWithString:@"http://p1.pichost.me/i/40/1639665.png"] placeholderImage:nil options:SDWebImageCacheMemoryOnly progress:^(NSInteger receivedSize, NSInteger expectedSize) { pv = [[UIProgressView alloc]initWithProgressViewStyle:(UIProgressViewStyleDefault)]; pv.frame = CGRectMake(0, 0, 400, 20); pv.center = self.view.center; NSLog(@"%ld,%ld",receivedSize,expectedSize); float currentProgress = (float)receivedSize/(float)expectedSize; pv.progress = currentProgress; [self.imv addSubview:pv]; } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) { [pv removeFromSuperview]; }];}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}
0 0
- SDWebImage加进度条展示图片下载进度
- android异步任务图片下载(进度条提示进度)
- Retrofit多线程下载加进度条展示
- iOS开发- SDWebImage图片下载缓存
- 图片下载添加进度条
- android实现图片下载到sdcard中的例子,用进度条显示现在进度,同时间图片显示出来
- Dialog显示图片下载进度案例
- 自定义控件:水平进度条,主要是用于展示一些任务进度
- 在 WinForm 中使用进度条展示长时间任务的执行进度
- 使用SDWebImage实现图片下载的原理
- 代码片--Android--图片下载进度条
- svg 环形进度条加读取进度效果(读数效果)-- 移动端 rem 适配
- shell进度展示案例
- scala学习进度展示
- 进度条的进度
- 使用进度条指示进度
- 进度条进度计算
- 【进度控制】SeekBar进度条
- JSP(JavaServer Pages)
- 利用Radio Button、Check Box、Date Picker和Slider作出选择
- hdu1254 推箱子
- 内存计数器实现限频
- 循环结构
- SDWebImage加进度条展示图片下载进度
- 026.LinkedList底层详解
- easy-size控件自适应大小的使用
- vector中存放自定义类 ,对类的要求
- 【大话GSM】WCDMA和LTE在提供数据和语音业务上的差异
- Markdown快速入门
- 15-11-16 Eclipse 操作菜单汉译之 Help [帮助]
- 为你详解安装arm-linux-gcc
- frame bounds center