I'm trying to universally change the background color for my table views. It is a combination UINavigationController and TabBarController app. I've tried putting the following in AppDelegate applicationDidFinishLaunchingWithOptions
[[[UITableView appearance] backgroundView] setBackgroundColor:[UIColor redColor]];
[[UITableView appearance] setBackgroundColor:[UIColor redColor]];
[[UITableView appearanceWhenContainedIn:[UINavigationController class], nil] setBackgroundColor:[UIColor greenColor]];
[[UITableView appearanceWhenContainedIn:[UITabBarController class], nil] setBackgroundColor:[UIColor greenColor]];
No change.
If I try to change general UIView in AppDelegate, this works:
[[UIView appearance] setBackgroundColor:[UIColor redColor]];
If I attack each tableview individually in viewDidLoad, this works:
self.tableView.backgroundColor = [UIColor redColor];
I realize it's just one line of code, but with a lot of views, it's just another thing to keep track of. It seems like the iOS 5 UIAppearance was made for this. I'm not clear why it isn't working. Thanks.