MDCTextInputPositioningDelegate

@protocol MDCTextInputPositioningDelegate <NSObject>

MDCTextInputPositioningDelegate allows objects outside an MDCTextInput, like MDCTextInputController, to pass the MDCTextInput important layout information.

Usually, these methods are direct mirrors of internal methods with the addition of a default value.

  • The actual input view and the rendered inputted text’s position is determined by applying these insets to the bounds.

    Declaration

    Objective-C

    - (UIEdgeInsets)textInsets:(UIEdgeInsets)defaultInsets;

    Parameters

    defaultInsets

    The value of text container insets that the MDCTextInput has calculated by default.

  • The area that inputted text should be displayed while isEditing = true.

    Declaration

    Objective-C

    - (CGRect)editingRectForBounds:(CGRect)bounds defaultRect:(CGRect)defaultRect;

    Parameters

    defaultRect

    The default value of the editing rect. It is usually the text rect shrunk or enlarged depending on rightView, leftView, or clearButton presences.

  • The area that the leadingView should inhabit when shown.

    Declaration

    Objective-C

    - (CGRect)leadingViewRectForBounds:(CGRect)bounds
                           defaultRect:(CGRect)defaultRect;

    Parameters

    defaultRect

    The default value of the leading view rect.

  • The amount of horizontal space between the leading view and the text input box.

    Defaults to 0.0;

    Declaration

    Objective-C

    - (CGFloat)leadingViewTrailingPaddingConstant;
  • Called from the end of the input’s layoutSubviews.

    Declaration

    Objective-C

    - (void)textInputDidLayoutSubviews;
  • Called from the end of the input’s updateConstraints.

    Declaration

    Objective-C

    - (void)textInputDidUpdateConstraints;
  • The area that the trailingView should inhabit when shown.

    Declaration

    Objective-C

    - (CGRect)trailingViewRectForBounds:(CGRect)bounds
                            defaultRect:(CGRect)defaultRect;

    Parameters

    defaultRect

    The default value of the trailing view rect.

  • The amount of horizontal space between the trailing view and the text input box.

    Defaults to 0.0;

    Declaration

    Objective-C

    - (CGFloat)trailingViewTrailingPaddingConstant;