MDCTextInputControllerFloatingPlaceholder

@protocol MDCTextInputControllerFloatingPlaceholder <MDCTextInputController>

Controllers that have the ability to move the placeholder to a title position.

Note: The Design guidance changed and treats placeholder as distinct from label text. The placeholder-related properties of this class most closely align with the label text as described in the guidance.

  • The color applied to the placeholder when floating and the text field is first responder. However, when in error state, it will be colored with the floatingPlaceholderErrorActive Color.

    Only relevant when floatingEnabled is true.

    Default is floatingPlaceholderActiveColorDefault.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, null_resettable)
        UIColor *floatingPlaceholderActiveColor;
  • Default value for floatingPlaceholderActiveColor.

    Default is activeColor.

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readwrite, null_resettable)
        UIColor *floatingPlaceholderActiveColorDefault;
  • The color applied to the placeholder when floating. However, when in error state, it will be colored with the error color and when in active state, it will be colored with the active color.

    Only relevant when floatingEnabled is true.

    Default is floatingPlaceholderNormalColorDefault.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, null_resettable)
        UIColor *floatingPlaceholderNormalColor;
  • Default value for floatingPlaceholderNormalColor.

    Default is black with Material Design hint text opacity (textInput’s tint).

    Declaration

    Objective-C

    @property (class, nonatomic, strong, readwrite, null_resettable)
        UIColor *floatingPlaceholderNormalColorDefault;
  • The error color of the border of the input field while being in edit mode. The color applied to the placeholder when floating and the text field is first responder and is in the error state.

    Only relevent when floatingEnabled is true.

    Default is errorColor.

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, nullable)
        UIColor *floatingPlaceholderErrorActiveColor;
  • When the placeholder floats up, constraints are created that use this value for constants.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIOffset floatingPlaceholderOffset;
  • The scale of the the floating placeholder label in comparison to the inline placeholder specified as a value from 0.0 to 1.0. Only relevant when floatingEnabled = true.

    If nil, the floatingPlaceholderScale is @(floatingPlaceholderScaleDefault).

    Declaration

    Objective-C

    @property (nonatomic, strong, readwrite, null_resettable)
        NSNumber *floatingPlaceholderScale;
  • Default value for the floating placeholder scale. NOTE:Setting this value to 0 or lower would automatically set the scale to default. Default is 0.75.

    Declaration

    Objective-C

    @property (class, nonatomic, assign, unsafe_unretained, readwrite)
        CGFloat floatingPlaceholderScaleDefault;
  • If enabled, the inline placeholder label will float above the input when there is inputted text or the field is being edited.

    Default is floatingEnabledDefault.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isFloatingEnabled) BOOL floatingEnabled;
  • Default value for floatingEnabled.

    Default is YES.

    Declaration

    Objective-C

    @property (class, nonatomic, assign, unsafe_unretained, readwrite,
              getter=isFloatingEnabledDefault) BOOL floatingEnabledDefault;