I\'am trying to setup a png image as my tableview\'s background. With the following code all are fine! But only on iPhone Simulator. If I try to run the application on an iPhone
A little late but maybe for all the others looking for a solution. I could get that work by using the following code in the viewDidLoad
method of the UITableViewController
:
self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
self.tableView.backgroundColor = [UIColor clearColor];
or with using just a background color:
self.parentViewController.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
self.tableView.backgroundColor = [UIColor clearColor];
It took me a while to figure that out but now it works like a charm.