Ok, so I was finally able to figure out a workaround for this. See my comment on the current answer, which explains why this answer does not work for me.
To repeat the iteration, from what I can tell, the iOS code creating the keyboard accessory explicitly sets the UIToolbar background, so you wonβt get the UIAppearance background setting, but you get your UIBarButtonItem style. The result is a dilapidated look that can look pretty bad. Fortunately, my designer was fine with a return to the default style for this particular case.
So the trick really was to figure out how to get this look, so as NOT to get the style through UIAppearance. I did this to replace this:
id barButtonAppearanceProxy = [UIBarButtonItem appearance];
Wherein:
// wtf: Style any UIBarButtonItem associated with a UIViewController id barButtonAppearanceProxy = [UIBarButtonItem appearanceWhenContainedIn:[UIViewController class], nil];
At first it seemed strange to me because I was thinking about restraint in terms of view-heirarchy ... But it just says that we will only stylize the UIBarButtonItems associated with the UIViewController. The reason this does not affect the keyboard accessory is because it directly added the parent view window and is not related to the UIViewController.
This is not an ideal solution, because ideally we would simply attach the keyboard to the accessory with UIAppearance. It is also assumed that all of your toolbars are associated with UIViewControllers. Fortunately for me (and probably for most of you) this is usually the case.
tyler
source share