Strange Behavior with UIAppearance UIBarButtonItem Back Button Background Image

283 views Asked by At

I'm trying to globally customize the back button for view controllers in an iOS app by changing the back button background image using the UIAppearance Proxy like this:

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

This is called immediately after the application launches, in the app delegate. For each view controller in the application the back button shows no background image when it first appears. After pressing the now invisible back button or another view controller is pushed, the background image appears and remains there.

What could cause this strange behavior? How can I make the background image appear immediately?

0

There are 0 answers