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

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

SDWebImage第三方框架
//SDWebImage框架setImageWithURL 把我们解析出来的头像网址变成头像显示
- (void)setItem:(CellItem *)item{
_conetentLabel.text = item.contentString;
[_headerImageView sd_setImageWithURL:[NSURL URLWithString:item.imageURL]];
NSLog(@"------>%@",item.imageURL);
}
YYKit第三方框架
github下载,直接把所需文件夹拖进工程

导入框架所需要的库

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

- (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);
}
网友评论