【iOS开发】关于图片加载的第三方框架SDWebImage的使用

SDWebImage是一个第三方框架,用于加载网络图片,,还有其他一些好的功能

使用步骤

下载地址 https://github.com/rs/SDWebImage

下载以后解压,解压以后是下图

然后将文件中的SDWebImage文件夹拖到项目中,然后在项目中使用

使用框架#import “SDWebImage/UIImageView+WebCache.h”//引入头文件-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {static NSString *ID = @”video”;UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];if(cell == nil) {cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];}NSString *imageUrl = [NSString stringWithFormat:@”http://192.168.1.101:8080/TFServer/%@”, video.image];//使用这个框架[cell.imageView setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:[UIImage imageNamed:@”4.jpg”]];return cell;}

流转的时光,都成为命途中美丽的点缀,

【iOS开发】关于图片加载的第三方框架SDWebImage的使用

相关文章:

你感兴趣的文章:

标签云: