I had a simple UITableView, and the cells are a subclass of UITableViewCell.
In a cell subclass, I overridden drawRect to insert this drawing code (for the vertical separator):
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(c, [[UIColor grayColor] CGColor]);
CGContextBeginPath(c);
CGContextMoveToPoint(c, self.frame.size.height + 0.5f, 0);
CGContextAddLineToPoint(c, self.frame.size.height + 0.5f, self.frame.size.height);
CGContextStrokePath(c);
He did a great job. However, now I have changed the style of tableview to grouping. The line is simply not drawn. Although the breakpoint settings show the drawRect method, it is called.
I would like to avoid subclassing UIView just to draw a small row, especially since I have already subclassed the tableview cell, and I just want to draw it. So why does the code suddenly stop working on a grouped table view?
source
share