iOS tableView 自定义sepatator

  可以设置分割线的高度并填充颜色。

- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetLineWidth(context, 2.0);
    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
    CGContextFillRect(context, rect);
    
    CGContextSetStrokeColorWithColor(context, ViewBgColor.CGColor);
    CGContextStrokeRect(context, CGRectMake(0, rect.size.height - 2, rect.size.width, 2));
}

 

posted @ 2017-04-26 10:48  听风gcl  阅读(191)  评论(0编辑  收藏  举报