UIBarButtonItem Appearance Ignores Custom Background Images for Plain or Bordered Styles

Originator:jaredsinclair.rn
Number:rdar://15814645 Date Originated:14-Jan-2014 12:02 PM
Status:Open Resolved:
Product:iOS SDK Product Version:7.1 Beta 3
Classification:UI/Usability Reproducible:Always
 
SUMMARY:

UIBarButtonItem Appearance Ignores Custom Background Images for Plain or Bordered Styles. The button items are presented using only their display text, ignoring custom background images set via the UIAppearance protocol.


STEPS TO REPRODUCE:

Set a custom background image for UIBarButtonItem using the UIAppearance protocol:

UIImage *barButtonImage_normal = <A_BUTTON_IMAGE>

[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationController class], nil] 
setBackgroundImage:barButtonImage_normal
forState:UIControlStateNormal
style:UIBarButtonItemStyleBordered
barMetrics:UIBarMetricsDefault];



EXPECTED RESULTS:

There should be a button image.


ACTUAL RESULTS:

There's no button image.

REGRESSION:

Only plain and bordered style buttons are affected. Strangely, button images set for items of style UIBarButtonItemStyleDone will appear as expected.

NOTES:

I have not been able to find any workarounds. This behavior is new to iOS 7.1 Beta 3.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!