I have a transparent section header in a UITableView, which should let the cells scroll behind it but show the background image which is behind the tableview instead of the cells. I need a way to apply some sort of clipping mask to the section header which would make any views which go beneath it transparent, or something which shows the appropriate part of the background image as the header's background and follows when the header moves.
I have seen this How to mask UITableViewCells underneath a UITableView Transparent Header, but it doesn't quite work as advertised, and is generally a bad implementation.
I have also tried this:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, self.frame);
CGContextSetBlendMode(context, kCGBlendModeClear);
}
in the section header's subclass, but this just shows the view with a black background.
If you need more explanation, here is what I have:
http://imgur.com/a/YM5Us
and here is what I want to achieve:
http://imgur.com/a/o9CgL