Instance Property


The overlay view displayed on the right (or trailing) side of the text field.


@property(nonatomic, strong) UIView *rightView;


You can use the right overlay view to provide indicate additional features available for the text field. For example, you might display a bookmarks button in this location to allow the user to select from a set of predefined items. The right overlay view flips automatically in a right-to-left user interface.

The right overlay view is placed in the rectangle returned by the rightViewRectForBounds: method of the receiver. The image associated with this property should fit the given rectangle. If it does not fit, it is scaled to fit. If you specify a control for your view, that control tracks and sends actions as usual.

If your right overlay view overlaps a sibling view, such as the clear button, you must use the UITextFieldViewMode to implement proper behavior. For example, if clearButtonMode is set to display the clear button, you can set the right overlay view’s rightViewMode to UITextFieldViewModeUnlessEditing to reveal the clear button during editing when the text field has contents.

See Also

Managing Overlay Views


Controls when the standard clear button appears in the text field.


The overlay view displayed on the left (or leading) side of the text field.


Controls when the left overlay view appears in the text field.


Controls when the right overlay view appears in the text field.


Defines the times at which overlay views appear in a text field.