UILabel does not draw background color text attribute under some situations

Originator:cheleball
Number:rdar://19786195 Date Originated:10-Feb-2015
Status:Closed Resolved:iOS 9 beta 1
Product:iOS Product Version:8.1.3
Classification:Other Reproducible:Always
 
Summary:
A UILabel will not draw a background color attribute if the following conditions are true:

1. An NSAttributedString object is created with a single background color attribute
2. The range of the attribute does not begin at location 0

Steps to Reproduce:
NOTE: I could not attach the example project here on open radar, but it's easy enough to reproduce on your own

1. Add a UILabel to a UIView and connect it to an outlet in your view controller
2. Construct a single NSAttributedString with a background color attribute and a range that does not start at 0
3. Set the label's attributedText property to your attributed string.
4. Run. You will not see your background color.

Background colors ARE rendered when they begin at location 0, and also when there is more than one range in the attributed string.

Expected Results:
A UILabel should be able to display a background color, even if there is only one range and that range falls in the middle of the string.

Actual Results:
The label does not display the highlight in these conditions.

Version:
iOS 8.1.3 (12B466)

Notes:


Configuration:
First found on original iPad Mini 16 GB Wifi (MF432LL/A), also shows up in iPhone simulator

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!