UITextField's -attributedPlaceholder method does not take NSFontAttributeName into account

Originator:GeoffPado
Number:rdar://15698364 Date Originated:12-19-2013
Status:Open Resolved:
Product:iOS SDK Product Version:7.0
Classification:Enhancement Reproducible:Always
 
Summary:
The documentation for UITextField's -attributedPlaceholder method states: "If set, the placeholder string is drawn using a 70% grey color and the remaining style information (except the text color) of the attributed string." However, setting the font using NSFontAttributeName is ignored when displaying the placeholder text.

Steps to Reproduce:
Steps to Reproduce:
1. Create a UITextField.
2. Call that text field's -attributedPlaceholder method:

self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"lorem ipsum" attributes:@{NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue-ThinItalic" size:24.0f]}];

Expected Results:
The text field displays the placeholder text in the font specified by NSFontAttributeName.

Actual Results:
The text field displays the placeholder text in the font returned by -font.

Version:
iOS SDK 7.0 (iphoneos7.0)

Notes:
This was found in an attempt to make the placeholder text display differently from the text that the user would actually type. We wanted to have the placeholder text be more stylized while the input text would allow for normal input.

A matching bug to requesting that the documentation match behavior has also been filed. rdar://15698327 (http://openradar.appspot.com/radar?id=5338551470260224)

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!