2
我在我的UITableViewCell下面的代码:优化圆角性能
[self.layer setBorderColor:[UIColor blackColor].CGColor];
[self.layer setShadowRadius:10.0];
[self.layer setCornerRadius:5.0];
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(5.0, 5.0)];
[self.layer setShadowPath:path.CGPath];
[self.layer setShouldRasterize:YES];
[self.layer setRasterizationScale:[UIScreen mainScreen].scale];
当我运行仪器,并设置颜色屏幕外 - 呈现黄色,这导致细胞是黄色的。当我移除shouldRasterize时,它不会使细胞变黄。有什么方法可以改善这一点? 这大大伤害了我的滚动性能。我只是想设置一些带有阴影的圆角。
这并没有帮助。我尝试过,当我使用屏幕外的颜色进行配置文件时,仍然给我一个黄色单元格 – adit