使用SDWebImage淡入淡出的方式加载图片
使用SDWebImage淡入淡出的方式加载图片

效果:

请通过以下方式下载源码:

找到它修改文件的地方:

以下是使用源码:
//
// ViewController.m
// SDWebImageFade
//
// Created by YouXianMing on 14-10-5.
// Copyright (c) 2014年 YouXianMing. All rights reserved.
// #import "ViewController.h"
#import "UIImageView+WebCache.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad {
[super viewDidLoad]; NSString *picUrl = @"http://th04.deviantart.net/fs70/PRE/i/2014/277/4/b/cheetahr_by_harpiya-d81l8iv.jpg"; UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:imageView]; [imageView setImageWithURL:[NSURL URLWithString:picUrl]
placeholderImage:nil
options:SDWebImageCacheMemoryOnly
progress:^(NSInteger receivedSize, NSInteger expectedSize) {
NSLog(@"%.2f", (float)receivedSize / (float)expectedSize);
}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) { }];
} @end
以下是需要注意的地方

使用SDWebImage淡入淡出的方式加载图片的更多相关文章
- iOS两种方式加载图片的区别
加载图片的方式: imageNamed: imageWithContentsOfFile: 加载Assets.xcassets这里面的图片: 1> 打包后变成Assets.car 2> 拿 ...
- java用流的方式加载图片
前端: <img ng-show="photo" class="vertical_b" id="photoImg" src=" ...
- [MISSAJJ原创]cell内 通过SDWebImage自定义创建动态菊花加载指示器
最后更新已经放到了github上了 MISSAJJ自己写的一个基于SDWebImage自定义的管理网络图片加载的工具类(普通图片加载,渐现Alpha图片加载,菊花Indicator动画加载) 经常在项 ...
- React Native两种加载图片的方式
1 加载网络图片 通过uri就可以加载网络图片 <Image source={{uri:'http://facebook.github.io/react/img/logo_og.png'}} s ...
- [Android]异步加载图片,内存缓存,文件缓存,imageview显示图片时增加淡入淡出动画
以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/3574131.html 这个可以实现ImageView异步加载 ...
- React-Native ListView加载图片淡入淡出效果的组件
今天练习项目中需要给listview在加载图片时增加一个淡入淡出的效果,因此干脆就自己封装了一个组件: 'use strict' import React from 'react-native' va ...
- MVC Ajax Helper或jQuery异步方式加载部分视图
Model: namespace MvcApplication1.Models { public class Team { public string Preletter { get; set; } ...
- java基础-jdbc——三种方式加载驱动建立连接
String url = "jdbc:mysql://localhost:3306/student?Unicode=true&characterEncoding=utf-8" ...
- 重新想象 Windows 8 Store Apps (54) - 绑定: 增量方式加载数据
[源码下载] 重新想象 Windows 8 Store Apps (54) - 绑定: 增量方式加载数据 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 绑定 通过实 ...
随机推荐
- MySQL 报错MySQL server syntax to use near 'OPTION SQL_SELECT_LIMIT=DEFAULT'
在hive的应用中,出现如下错误时You have an error in your SQL syntax; check the manual that corresponds to your MyS ...
- [Linux]——进程管理相关
一些概念 程序program:通常以二进制程序放置在存储媒介中,以物理文件形式存在 进程process:程序通过用户执行被触发后,执行者的权限与属性.程序的代码和所需数据会被加载到内存中,OS给予这个 ...
- [WC 2018]州区划分
Description 题库链接 小 \(S\) 现在拥有 \(n\) 座城市,第 \(i\) 座城市的人口为 \(w_i\) ,城市与城市之间可能有双向道路相连. 现在小 \(S\) 要将这 \(n ...
- Git报错:error: cannot open .git/FETCH_HEAD: Read-only file system
Git:git pull时报错 error: cannot open .git/FETCH_HEAD: Read-only file system 查看该文件: 未在网上找到解决办法,重启服务器就好了 ...
- favi.icon是什么?
各大网站都有属于自己的图标 概念解释: ico是Icon file的缩写,是Windows的图标文件格式的一种 1.制作ico格式的图片一个上传到服务器的根目录图片保存为favicon.ico 2.制 ...
- 读取配置文件-AppConfig
using System.Xml; using System.IO; using System; namespace Framework.Common { /// <summary> // ...
- 鼠标样式——css国际组织
w3c国际标准组织提供的鼠标样式: http://css-cursor.techstream.org/
- Spark你需要知道这些
谈到 Spark,我们总是强调它比 Hadoop 更高效.为什么它可以更高效呢?是因为它优先使用内存存储?还是因为它拥有比 MapReduce 更简单高效的计算模型? 与 Hadoop 作业的区别 我 ...
- CSS reset的审视
by zhangxinxu from http://www.zhangxinxu.com本文地址:http://www.zhangxinxu.com/wordpress/?p=758 一.CSS re ...
- js中var、let、const区别
javascript中有三种声明变量的方式:var.let.const 1.var 作用域:全局或局部 var的作用域可以是全局或是局部,以下分四种情况说明: (1).当var关键字声明于函数内时是局 ...