码迷,mamicode.com
首页 > Web开发 > 详细

SDWebImage

时间:2014-11-27 23:21:08      阅读:320      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   os   使用   sp   on   div   2014   

SDWebImage中的一些参数: 

* SDWebImageRetryFailed = 1<< 0,    默认选项,失败后重试

* SDWebImageLowPriority = 1<< 1,     使用低优先级

* SDWebImageCacheMemoryOnly = 1<< 2,    仅仅使用内存缓存

* SDWebImageProgressiveDownload = 1<< 3,    显示现在进度

* SDWebImageRefreshCached = 1<< 4,     刷新缓存

* SDWebImageContinueInBackground =1 << 5,    后台继续下载图像

* SDWebImageHandleCookies = 1<< 6,     处理 Cookie

* SDWebImageAllowInvalidSSLCertificates= 1 << 7,     允许无效的 SSL 验证

* SDWebImageHighPriority = 1<< 8,      高优先级

* SDWebImageDelayPlaceholder = 1<< 9      延迟显示占位图片

 

 

 

 

 

 

 

 

 

 

 

 

 

//

//  ZBMainViewController.m

//  SDWebImageDemo

//

//  Created by 张先森 on 14/11/27.

//  Copyright (c) 2014年 zhibin. All rights reserved.

//

 

#import "ZBMainViewController.h"

#import "UIImageView+WebCache.h"

@interface ZBMainViewController ()

 

@end

 

@implementation ZBMainViewController

 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

{

    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

    if (self) {

        // Custom initialization

    }

    return self;

}

 

- (void)viewDidLoad

{

    [super viewDidLoad];

    UIImageView *imageview=[[UIImageView alloc] initWithFrame:self.view.bounds];

    [self.view addSubview:imageview];

    NSURL *url=[NSURL URLWithString:@"http://img.xmfish.com/attachment/Mon_1411/6_1298069_060594db2f0cdcc.jpg"];

    

    

    [imageview setImageWithURL:url placeholderImage:[UIImage imageNamed:@"tabbar_profile_selected_os7"] options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize) {

      

        NSLog(@"%.2f",(float)receivedSize/(float)expectedSize);

        

    } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {

        

    }];

 

    

}

 

 

 

@end

 

SDWebImage

标签:http   io   ar   os   使用   sp   on   div   2014   

原文地址:http://www.cnblogs.com/zhibin/p/4127401.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!