SDWebImage_ClipStrategy
中文:
SDWebImage支持圆角功能
iOS上使用UIImageView.layer.cornerRadius设置圆角的话,会影响性能。
苦于SDWebImage里面没有图片设置圆角的功能,所以我对SDWebImage进行了改造,使其支持直接输出圆角图片
并且不影响SDWebImage里面的硬盘缓存,原图不会在内存里有一份缓存。
github地址
https://github.com/170warship/SDWebImage_ClipStrategy
使用例子:
UIImageView* imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 150)];
NSString* imgUrl = @"http://img1.gtimg.com/news/pics/hv1/9/44/2218/144236679.jpg";
[imgView sd_setImageWithURL:[NSURL URLWithString:imgUrl width:imgView.width height:imgView.height cornerRadius:5]];
本文介绍了一种对SDWebImage的改进方法,使其能够直接输出带有圆角的图片,该方法不会影响原有的硬盘缓存机制,并提供了一个具体的使用案例。
629

被折叠的 条评论
为什么被折叠?



