1.下载sdwebimage库:https://github.com/rs/SDWebImage
2.解压把下面的文件导入到工程里面
SDWebImage的使用
3.在需要用到的地方导入文件头#import “SDWebImage/UIImageView+WebCache.h”
这时如果你事先没有配置路径,那么则会报错找不到该文件,所以要进行配置
SDWebImage的使用
4,配置好之后则可以使用
UIImageView *imageview = [[UIImageView alloc]init];
imageview.frame = CGRectMake(100, 100, 100, 200);
[imageview sd_setImageWithURL:[NSURL URLWithString:@”http://g.hiphotos.baidu.com/image/pic/item/6c224f4a20a446230761b9b79c22720e0df3d7bf.jpg“]];
[self.view addSubview:imageview];

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-12-22
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-01-08
相关资源
相似解决方案