im trying to make a menu like FIFA app but i can't put the tableview in a transparent color,so the background image can be visible, can anyone help me?? I've tried of everything, any of this answers worked for me: UITableView clear background so i really need your help.
Asked
Active
Viewed 1,465 times
1 Answers
2
In addition to setting the background color of the table view to clear, you have to set the background color of the table view cells. And that, at least in my experience, has been somewhat tricky and couldn't be easily done via Interface Builder (the storyboard or the xib).
So you have to set the background color on your cells directly. For example, during your tableView:willDisplayCell:forRowAtIndexPath:
delegate method, you'd do something like:
cell.backgroundColor = [UIColor clearColor];
And as rmaddy points out, Apple documentation for that method states:
This method gives the delegate a chance to override state-based properties set earlier by the table view, such as selection and background color.

Michael Dautermann
- 88,797
- 17
- 166
- 215
-
Actually the cell background needs to be set in the `tableView:willDisplayCell:forRowAtIndexPath:` method. – rmaddy Feb 03 '14 at 21:42
-
My experience has been that is really only works in the `willDisplayCell...` delegate. The docs for `willDisplayCell...` also state to use it to set the background color. – rmaddy Feb 03 '14 at 21:47
-
yeah, I see it in the documentation, and I've updated my answer. Thanks! – Michael Dautermann Feb 03 '14 at 21:54
-
Didn't work yet, heres how the tableview looks like, maybe helps, its in a container view: freeimagehosting net/scgnp – Karlo A. Lopez Feb 03 '14 at 22:16
-
Did you set the *delegate* of the table view? It's a separate thing from the table view data source. – Michael Dautermann Feb 03 '14 at 23:05