我的每个UITableView单元上都有一个UIImageView,它显示一个远程图像(使用SDWebImage)。我已经对图像视图进行了一些QuartzCore层样式设置,如下所示:
UIImageView *itemImageView = (UIImageView *)[cell viewWithTag:100];
itemImageView.layer.borderWidth = 1.0f;
itemImageView.layer.borderColor = [UIColor concreteColor].CGColor;
itemImageView.layer.masksToBounds = NO;
itemImageView.clipsToBounds = YES;所以现在我有一个50x50的正方形,有一个灰色的边框,但我想让它变成圆形而不是正方形。应用程序Hemoglobe在表视图中使用圆形图像,这就是我想要实现的效果。然而,我不想使用cornerRadius,因为那会降低我的滚动FPS。
下面是显示循环UIImageViews的Hemoglobe:

有什么方法可以达到这种效果吗?谢谢。
发布于 2014-05-22 19:11:31
添加边框的步骤
self.ImageView.layer.borderWidth = 3.0f;
self.ImageView.layer.borderColor = [UIColor whiteColor].CGColor;对于圆形
self.ImageView.layer.cornerRadius = self.ImageView.frame.size.width / 2;
self.ImageView.clipsToBounds = YES;请参考此链接
http://www.appcoda.com/ios-programming-circular-image-calayer/
https://stackoverflow.com/questions/17721934
复制相似问题