I realize that iOS 7 has not officially been released and we should not discuss it BUT I am going crazy trying to figure out this problem. On iOS 6, my table view was transparent and looked great. First time running iOS 7, and the background is white.
I have tried making the table backgroundColor, cell color etc etc to UIColor clearColor but have no change.
How to fix this problem?
// Fix for iOS 7 to clear backgroundColor
cell.backgroundColor = [UIColor clearColor];
cell.backgroundView = [[UIView new] autorelease];
cell.selectedBackgroundView = [[UIView new] autorelease];
in cellForRowAtIndexPath
Also, make sure that your tableview actually has transparent background (in storyboard):
Put this:
cell.backgroundColor = [UIColor clearColor];
In this section:
cellForRowAtIndexPath
Try setting backgroundView to nil first.
[self.tableView setBackgroundView:nil];
[self.tableView setBackgroundColor:[UIColor clearColor]];
Not sure if this is a change in documentation with iOS7 or has always been there and just did not affect background color, but per UITableView Class Reference @property backgroundView
"You must set this property to nil to set the background color of the table view."
edit: corrected code syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With