Instance Method

drawPlaceholderInRect:

Draws the receiver’s placeholder text in the specified rectangle.

Declaration

- (void)drawPlaceholderInRect:(CGRect)rect;

Parameters

rect

The rectangle in which to draw the placeholder text.

Discussion

You should not call this method directly. If you want to customize the drawing behavior for the placeholder text, you can override this method to do your drawing.

By the time this method is called, the current graphics context is already configured with the default environment and text color for drawing. In your overridden method, you can configure the current context further and then invoke super to do the actual drawing or do the drawing yourself. If you do render the text yourself, you should not invoke super.

See Also

Drawing and Positioning Overrides

- textRectForBounds:

Returns the drawing rectangle for the text field’s text.

- drawTextInRect:

Draws the receiver’s text in the specified rectangle.

- placeholderRectForBounds:

Returns the drawing rectangle for the text field’s placeholder text

- borderRectForBounds:

Returns the receiver’s border rectangle.

- editingRectForBounds:

Returns the rectangle in which editable text can be displayed.

- clearButtonRectForBounds:

Returns the drawing rectangle for the built-in clear button.

- leftViewRectForBounds:

Returns the drawing rectangle of the receiver’s left overlay view.

- rightViewRectForBounds:

Returns the drawing location of the receiver’s right overlay view.