UITableViewCell自定义分割线

//不画分割线
  tvDailySetting . separatorStyle  =  UITableViewCellSelectionStyleNone ;
 

//自绘分割线

-(void) drawRect:(CGRect)rect

{

    CGContextRef context = UIGraphicsGetCurrentContext();

    

    CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);

    CGContextFillRect(context, rect);

    

    CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:1/255.0f green:1/255.0f blue:1/255.0f alpha:1].CGColor);

    CGContextStrokeRect(context, CGRectMake(15, rect.size.height, rect.size.width-301));

}  

你可能感兴趣的:(UITableViewCell自定义分割线)