Instance Property

attributedPlaceholder

The styled string that is displayed when there is no other text in the text field.

Declaration

@property(nonatomic, copy) NSAttributedString *attributedPlaceholder;

Discussion

This property is nil by default. If set, the placeholder string is drawn using system-defined color and the remaining style information (except the text color) of the attributed string. Assigning a new value to this property also replaces the value of the placeholder property with the same string data, albeit without any formatting information. Assigning a new value to this property does not affect any other style-related properties of the text field.

See Also

Accessing the Text Attributes

text

The text displayed by the text field.

attributedText

The styled text displayed by the text field.

placeholder

The string that is displayed when there is no other text in the text field.

defaultTextAttributes

The default attributes to apply to the text.

font

The font of the text.

textColor

The color of the text.

textAlignment

The technique to use for aligning the text.

typingAttributes

The attributes to apply to new text being entered by the user.

UITextBorderStyle

The type of border drawn around the text field.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software