【发布时间】:2012-12-07 18:14:19
【问题描述】:
我有一个UITableViewCell,其中有5 个UILabel、一个UIButton 和一个UIImageView,它们将单元格作为背景填充。性能似乎有点慢,所以我正在考虑使用CoreGraphics 来改进它。使用CoreGraphics 而不是UILabel 作为subViews 是否真的会让事情变得更快?如果是,为什么?
我有以下代码在单元格上绘制阴影:
[self.layer setBorderColor:[UIColor blackColor].CGColor];
[self.layer setShadowColor:[UIColor blackColor].CGColor];
[self.layer setShadowRadius:10.0];
[self.layer setCornerRadius:5.0];
[self.layer setShadowPath:[[UIBezierPath bezierPathWithRect:self.frame] CGPath]];
【问题讨论】:
标签: ios iphone objective-c uitableview core-graphics