TableView desktop image in iPad

I have the following code that works fine in an iPhone application, but on an iPad I always get a gray / light blue background color. Even if I change the background color, it does not take effect.

[self.tableView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg1024x768.png"]]];

thank

+5
source share
1 answer

Here's the magic:

if ( [self.myTableView respondsToSelector:@selector(backgroundView)] )
    self.myTableView.backgroundView = nil;
self.myTableView.backgroundColor = [UIColor clearColor];

Also, use a UIViewController with a UITableView, not a UITableViewController, and put the background image in a UIImageView placed under the UITableView.

+8
source