码迷,mamicode.com
首页 > 移动开发 > 详细

iOS tableView 自定义sepatator

时间:2017-04-26 11:01:23      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:void   tor   clear   bsp   make   draw   log   class   高度   

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

- (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));
}

 

iOS tableView 自定义sepatator

标签:void   tor   clear   bsp   make   draw   log   class   高度   

原文地址:http://www.cnblogs.com/guchunli/p/6767427.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!