Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a background image to a grouped style UITableViewController in iOS 6?

Tags:

ios

ios6

self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"fullscreen-bg.png"]];
self.tableView.backgroundColor = [UIColor clearColor];

That code worked fine in iOS 5 but it doesn't work in iOS 6. In iOS 6 it just show the default pinstriped background. Any ideas?

like image 839
Steve Moser Avatar asked Dec 20 '22 16:12

Steve Moser


1 Answers

// FOR iOS 5
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.opaque = NO;

// FOR iOS 6
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
self.tableView.backgroundView = nil;
like image 131
Peter Warbo Avatar answered Dec 28 '22 06:12

Peter Warbo