i am used to doing the following to style all instances of UITableView
:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UITableView appearance] setBackgroundColor:[UIColor blueColor]];
return YES;
}
but on ios 8 this is not working anymore.
for the purpose of testing and demo i created a new master-detail project using xcode 6.0.1 which you can find on github.
running it on ios 7 works (table view gets blue background). on ios 8 not so much.
did i miss someting during the hype? is this a bug?
Update 2014-09-25
this appears to be a known bug. the apple radar # is 17974434 which is currently marked as open.
Had the same problem, reported another bug to Apple (rdar://18537175): http://openradar.appspot.com/18537175
It works for me:
[[UITableView appearance] setBackgroundColor:[UIColor clearColor]];
[[UITableView appearance] setBackgroundColor:[UIColor blueColor]];
Swift 3.1 is working like this:
UITableView.appearance().backgroundColor = UIColor.darkGray
UITableView.appearance().tintColor = UIColor.white
UITableViewCell.appearance().backgroundColor = UIColor.darkGray
UITableViewCell.appearance().tintColor = UIColor.white
Swift 3.1 is working like this:
UITableView.appearance().backgroundColor = UIColor.darkGray
UITableView.appearance().tintColor = UIColor.white
UITableViewCell.appearance().backgroundColor = UIColor.darkGray
UITableViewCell.appearance().tintColor = UIColor.white