I create my own UITableViewCells with gradient background. I have all the logic and the drawing, but the one thing I want to fix is ββthe "chunkiness" around the corners of my custom cell:
alt text http://grab.by/27SM
If you approach in the corners, you can see what I'm talking about. Here is the code I use to create the cell:
CGContextRef c = UIGraphicsGetCurrentContext(); CGColorSpaceRef myColorspace = CGColorSpaceCreateDeviceRGB(); CGGradientRef myGradient = nil; CGFloat components[8] = TABLE_CELL_BACKGROUND; CGContextSetStrokeColorWithColor(c, [[UAColor colorWithWhite:0.7 alpha:1] CGColor]); CGContextSetLineWidth(c, 2); CGContextSetAllowsAntialiasing(c, YES); CGContextSetShouldAntialias(c, YES); CGFloat minx = CGRectGetMinX(rect) , midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect) ; CGFloat miny = CGRectGetMinY(rect) , maxy = CGRectGetMaxY(rect) ; CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, minx, miny); CGPathAddArcToPoint(path, NULL, minx, maxy, midx, maxy, kDefaultMargin); CGPathAddArcToPoint(path, NULL, maxx, maxy, maxx, miny, kDefaultMargin); CGPathAddLineToPoint(path, NULL, maxx, miny); CGPathAddLineToPoint(path, NULL, minx, miny); CGPathCloseSubpath(path);
What can I do to smooth the edges while maintaining a constant edge thickness in all cells?