mattti
mattti

Reputation: 53

Static UITableViewCell backgroundColor always white on iPad

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

Answers (2)

Vatsal Raval
Vatsal Raval

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

eschanet
eschanet

Reputation: 1045

You should set the cell.contentView.backgroundColor, as @SandeepAggarwal has pointed out.

Upvotes: 5

Related Questions