In my case the cell was created using a xib. it seems like interface builder on xcode5 has trouble setting clearColor to the cell.backgroundColor.
All I needed to do was indeed to set
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// get the cell from the nib
//then force the backgroundColor
cell.backgroundColor = [UIColor clearColor]
return cell;
}
Actually the officially correct place to change cell background color is different according to documentation (UITableViewCell Class Reference):
Whether you use a predefined or custom cell, you can change the cell’s
background using the backgroundView property or by changing the
inherited backgroundColor property. In iOS 7, cells have a white
background by default; in earlier versions of iOS, cells inherit the
background color of the enclosing table view. If you want to change
the background color of a cell, do so in the
tableView:willDisplayCell:forRowAtIndexPath: method of your table view
delegate.
// Fix iOS 7 clear backgroundColor compatibility
// I Think this two lines only are enough
cell.backgroundColor = [UIColor clearColor];
cell.selectedBackgroundView = [[UIView new] autorelease];
You can't put the fix in cellForRowAtIndexPath because that is after the cell is rendered, and it will flash a white background before the background gets set to clear (on slower devices).
Use this delegate method and your problems are solved!
This did only work for me when i edited a clear background color for each cell and a clear color for the table itself.. BOTH PROGRAMMATICALLY
to set the clear color for the table:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
initMenu()
myTableView.backgroundColor = UIColor.clearColor()
}