【发布时间】:2013-07-17 07:31:11
【问题描述】:
我的每个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。
这里是Hemoglobe 显示循环UIImageViews:
有什么办法可以达到这个效果吗?谢谢。
【问题讨论】:
-
不是cornerRadius 影响性能,maskToBounds/clipsToBounds 是问题
标签: ios objective-c uitableview uiimageview