Reputation: 7633
I need to set an image to my UITableViewController; if i have just one section on the tableview it works fine with:
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"someImage.jpeg"]];
but if there are 2 section the image comes duplicate for each section.
Upvotes: 2
Views: 598
Reputation: 243156
Don't use a pattern image. Use the tableView's backgroundView
property:
UIImageView * background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"someImage.jpeg"]];
[[self tableView] setBackgroundView:background];
[background release];
Upvotes: 4