When I set the backgroundColor
for my UITableView
it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a lig
If your application targets both iPhone and iPad you can do it like this:
[myTableView setBackgroundColor:[UIColor clearColor]]; // this is for iPhone
if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPhone) {
[myTableView setBackgroundView:nil];
[myTableView setBackgroundView:[[UIView alloc] init]];
} // this is for iPad only
Notice that the TableView alloc doesn't have autorelease for ARC.