Thornaci Thornaci - 1 year ago 156
iOS Question

UITableView background image for all cells

I want to change my tableview background image. When i change it, the change doesn't effect the cells. I'm using xib for my cells which doesn't have any code inside it, just design. So how can i solve this?

self.list.backgroundView = [[UIImageView alloc] initWithImage:
[UIImage imageNamed:@"Pattern.png"]];


Answer Source

In your cellForRowAtIndexPath method, set your cell's background color to clear color. It will make your cells transparent and show the background image.

Objective C:

cell.backgroundColor = [UIColor clearColor];


cell.backgroundColor = UIColor.clearColor()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download