I would like to add a dotted bottom border to mine UITableViewCell.
I am currently using the following code,
CAShapeLayer *border = [CAShapeLayer layer];
border.strokeColor = [UIColor colorWithRed:67/255.0f green:37/255.0f blue:83/255.0f alpha:1].CGColor;
border.fillColor = nil;
border.lineDashPattern = @[@1, @1];
border.path = [UIBezierPath bezierPathWithRect:cell.bounds].CGPath;
border.frame = CGRectMake(cell.bounds.origin.x, cell.bounds.origin.y + cell.bounds.size.height, cell.bounds.size.width, 1);
[cell.layer addSublayer:border];
With this code, I have a dotted bottom border for my cell, but the height of the dotted border is twice too high.
But I did not manipulate very well CAShapeLayer, and I did not find anything to help me.
Thanks!
source
share