UITableViewCell分割线的自定义
一:将系统隐藏,自己自定义一条;
二:在cell中重写
// 重写底部分割线
-
(void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextFillRect(context, rect);CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0xE2/255.0f green:0xE2/255.0f blue:0xE2/255.0f alpha:0.9].CGColor);
CGContextStrokeRect(context, CGRectMake(10, rect.size.height - 0.5, rect.size.width-10, 0.5));
}