Update (2013/7/8) - This has been fixed in newer versions of iOS. However, it's worth knowing about if you're targeting iOS 6 or below.
You can blame Apple for this one, and it's actually pretty mean of them. Technically, backgroundColor
is not customizable through appearance proxies.
From Apple's documentation:
To support appearance customization, a class must conform to the UIAppearanceContainer protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR.
If we go into a class like UIBarButtonItem
and look at the tintColor
property we see this:
@property(nonatomic,retain) UIColor *tintColor UI_APPEARANCE_SELECTOR;
So because it's marked with the UI_APPEARANCE_SELECTOR
tag we know it works with UIAppearance
.
Here's where Apple are particularly mean: in a UIView
, backgroundColor
has no appearance selector tag, but still works with UIAppearance
. According to all the documentation Apple provide it should not, but yet it does!
This gives the misleading impression that it will work for all sub-classes of UIView
, including UITableView
. This has come up before, in this previous SO answer
So the bottom line is that backgroundColor
shouldn't work at all with UIAppearance
, but for some reason it does on a UIView
. It is not guaranteed to work on UIView
subclasses, and it doesn't work at all on UITableView
. Sorry I couldn't give you a more positive answer!