I would like to create a TRANSLUCENT grouped table view cell. In other words I want to see the grouped table view background pattern, but i don't want completely clear cells. I've seen a lot of questions about transparent cells but none address making translucent (only partially transparent) cells.
This is what I'm trying:
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.contentView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.5f];
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView.backgroundColor = [UIColor clearColor];
}
And this is the result:
It's almost right, except that the contentView of the cell extends beyond the rounded corners of the grouped cell.
SOLVED by using a transparent image and setting the cell's background view. Would have still liked to do it programmatically though, so if anyone has a solution, I will gladly accept it.
SOLVED Part II Can also be done by setting backgroundView to a new UIView, that has the desired background color and rounded corners via QuartzCore's setCornerRadius call to the view's layer property.