Reputation: 53
In my project, I have a static TableView. I changed the backgroundColor of the cells in interface builder. This shows correctly on iPhone.
However, on iPad the cells background is always white.
I found a solution for dynamic cells here, but as it is using the UITableViewDataSource protocol, i can't use it with my static table.
How could I solve this problem?
Upvotes: 3
Views: 552
Reputation: 313
- (void)tableView:(UITableView *)tableView
willDisplayCell:(UITableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell setBackgroundColor:[UIColor clearColor]];
}
try this , it will solve your problem
Upvotes: 0
Reputation: 1045
You should set the cell.contentView.backgroundColor
, as @SandeepAggarwal has pointed out.
Upvotes: 5