10.10 离屏渲染

2016-10-23  本文已影响11人  jayck

`![Uploading Paste_Image_582229.png . . .]
](https://img.haomeiwen.com/i2455916/2ee2a51fb70f30c2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

Paste_Image.png

我们可以使用一个中间被挖空的png盖在图片上,也能显示成圆角,而且也不会导致很卡。其实就是遮罩。

Paste_Image.png

SDWebImage第三方框架

//SDWebImage框架setImageWithURL 把我们解析出来的头像网址变成头像显示
- (void)setItem:(CellItem *)item{

    _conetentLabel.text = item.contentString;
    [_headerImageView sd_setImageWithURL:[NSURL URLWithString:item.imageURL]];
    NSLog(@"------>%@",item.imageURL);
}

YYKit第三方框架

github下载,直接把所需文件夹拖进工程

Paste_Image.png

导入框架所需要的库

Paste_Image.png

编译这两个文件后就可以使用了

Paste_Image.png
- (void)setItem:(CellItem *)item{

   _conetentLabel.text = item.contentString;
//    SDWebImage框架setImageWithURL 把我们解析出来的头像网址变成头像显示
//    [_headerImageView sd_setImageWithURL:[NSURL URLWithString:item.imageURL]];
   
   //YYKit框架性能比SDWeb框架好很多,推荐使用
   [_headerImageView.layer setImageURL:[NSURL URLWithString:item.imageURL]];
   NSLog(@"------>%@",item.imageURL);
}
上一篇 下一篇

猜你喜欢

热点阅读