zoukankan      html  css  js  c++  java
  • SDWebImage

    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

  • 相关阅读:
    C语言之指针基础概念
    Android之常用功能代码
    Android之ImageButton控件基础操作
    BZOJ1079或洛谷2476 [SCOI2008]着色方案
    HDOJ2870 Largest Submatrix
    BZOJ1855或洛谷2569 [SCOI2010]股票交易
    BZOJ1233 [Usaco2009Open]干草堆tower
    HDOJ4261 Estimation
    POJ3254或洛谷1879 Corn Fields
    POJ1037 A Decorative Fence
  • 原文地址:https://www.cnblogs.com/zhibin/p/4127401.html
Copyright © 2011-2022 走看看