menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfTextInputLayout - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfTextInputLayout

    The text input layout control adds decorative elements such as floating label, icons, and assistive labels on the top of the input views.

    Inheritance
    System.Object
    SfTextInputLayout
    DataFormItemTextInputLayout
    Namespace: Syncfusion.XForms.TextInputLayout
    Assembly: Syncfusion.Core.XForms.dll
    Syntax
    public class SfTextInputLayout : TemplatedView, IParentThemeElement, IThemeElement
    Examples
    <inputLayout:SfTextInputLayout Hint="Hint" HelperText="Helper" ErrorText="Error">
        <Entry />
    </inputLayout:SfTextInputLayout>

    Constructors

    SfTextInputLayout()

    Initializes a new instance of the SfTextInputLayout class.

    Declaration
    public SfTextInputLayout()

    Fields

    CharMaxLengthProperty

    Gets or sets the length of the maximum character value. When the character count reaches the character maximum length, the error color will be applied.

    Declaration
    public static readonly BindableProperty CharMaxLengthProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ContainerBackgroundColorProperty

    Gets or sets the background color of the container.

    Declaration
    public static readonly BindableProperty ContainerBackgroundColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ContainerTypeProperty

    Gets or sets a value that determines the appearance of background and its border.

    Declaration
    public static readonly BindableProperty ContainerTypeProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    CounterLabelStyleProperty

    Gets or sets the style for counter label.

    Declaration
    public static readonly BindableProperty CounterLabelStyleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    CurrentActiveColorProperty

    Gets a value for current active color based on input view focus state.

    Declaration
    public static readonly BindableProperty CurrentActiveColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    EnableFloatingProperty

    Gets or sets a value that indicates whether to float the label when it is focused or unfocused.

    Declaration
    public static readonly BindableProperty EnableFloatingProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    EnableHintAnimationProperty

    Gets or sets a value that indicates whether to enable animation for the hint text when the input view is focused or unfocused.

    Declaration
    public static readonly BindableProperty EnableHintAnimationProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if enable hint animation; otherwise, false.

    EnablePasswordVisibilityToggleProperty

    Gets or sets a value that indicates whether to show the password visibility toggle.

    Declaration
    public static readonly BindableProperty EnablePasswordVisibilityToggleProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if enable password visibility toggle; otherwise, false.

    Remarks

    This property supports for Xamarin.Forms.Entry only.

    ErrorColorProperty

    Gets or sets the color of the error text, line, and floating label text when setting error.

    Declaration
    public static readonly BindableProperty ErrorColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ErrorLabelStyleProperty

    Gets or sets the style for error label.

    Declaration
    public static readonly BindableProperty ErrorLabelStyleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ErrorTextProperty

    Gets or sets the value for validation error. It will be displayed till entering the correct text in the input view.

    Declaration
    public static readonly BindableProperty ErrorTextProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    FocusedColorProperty

    Gets or sets the color of the hint label and border when the control is focused.

    Declaration
    public static readonly BindableProperty FocusedColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    FocusedStrokeWidthProperty

    Gets or sets as value to customize the stroke width in focused state, it is applicable for the bottom line and outline border when setting the container type as filled and outlined respectively.

    Declaration
    public static readonly BindableProperty FocusedStrokeWidthProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HasErrorProperty

    Gets or sets a value that indicates whether it has validation errors.

    Declaration
    public static readonly BindableProperty HasErrorProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if has error; otherwise, false.

    HelperLabelStyleProperty

    Gets or sets the style for helper label.

    Declaration
    public static readonly BindableProperty HelperLabelStyleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HelperTextProperty

    Gets or sets a value for helper text in the input view. It conveys the additional information about the text in the input view.

    Declaration
    public static readonly BindableProperty HelperTextProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HintLabelStyleProperty

    Gets or sets the style for hint label.

    Declaration
    public static readonly BindableProperty HintLabelStyleProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    HintProperty

    Gets or sets a value for hint text in the input view.

    Declaration
    public static readonly BindableProperty HintProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    InputViewPaddingProperty

    Gets or sets desired padding to override default padding for input view.

    Declaration
    public static readonly BindableProperty InputViewPaddingProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    InputViewProperty

    Gets or sets the value for input view to place behind the hint label.

    Declaration
    public static readonly BindableProperty InputViewProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    IsEnabledProperty

    Gets or sets a value that indicates whether users can interact with the control.

    Declaration
    public static readonly BindableProperty IsEnabledProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    IsHintAlwaysFloatedProperty

    Gets or sets a value that indicates whether to fix the hint label always at the top even when the text is empty.

    Declaration
    public static readonly BindableProperty IsHintAlwaysFloatedProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    LeadingViewPositionProperty

    Gets or sets the value that determines whether to place the leading view within the layout.

    Declaration
    public static readonly BindableProperty LeadingViewPositionProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    LeadingViewProperty

    Gets or sets a value for a view to place before input view.

    Declaration
    public static readonly BindableProperty LeadingViewProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    OutlineCornerRadiusProperty

    Gets or sets a value to customize the customize the corner radius of outline border.

    Declaration
    public static readonly BindableProperty OutlineCornerRadiusProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    it is applicable only when set the container type as outlined.

    ReserveSpaceForAssistiveLabelsProperty

    Gets or sets a value indicating whether to allocate space for assistive labels. assistive labels includes helper text, error text and character counter.

    Declaration
    public static readonly BindableProperty ReserveSpaceForAssistiveLabelsProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty
    Remarks

    when this property is set as false, assitive labels will not be shown even they are not enabled.

    ShowCharCountProperty

    Gets or sets a value that indicates whether to display the character count when the value is changed.

    Declaration
    public static readonly BindableProperty ShowCharCountProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if enable counter; otherwise, false.

    ShowHelperTextProperty

    Gets or sets a value indicating whether to display the helper text. It determines the visibility of the helper text.

    Declaration
    public static readonly BindableProperty ShowHelperTextProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if show helper text; otherwise, false.

    ShowHintProperty

    Gets or sets a value that indicates whether to display the hint text.

    Declaration
    public static readonly BindableProperty ShowHintProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    true if show hint; otherwise, false.

    ShowLeadingViewProperty

    Identifies the ShowLeadingView bindable property.

    Declaration
    public static readonly BindableProperty ShowLeadingViewProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    ShowTrailingViewProperty

    Identifies the ShowTrailingView bindable property.

    Declaration
    public static readonly BindableProperty ShowTrailingViewProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    TrailingViewPositionProperty

    Gets or sets a value that determines whether to place the trailing view within the layout.

    Declaration
    public static readonly BindableProperty TrailingViewPositionProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    TrailingViewProperty

    Gets or sets a value for a view to place after input view.

    Declaration
    public static readonly BindableProperty TrailingViewProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    UnfocusedColorProperty

    Gets or sets the color of the hint label and border when the control is unfocused.

    Declaration
    public static readonly BindableProperty UnfocusedColorProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    UnfocusedStrokeWidthProperty

    Gets or sets as value to customize the stroke width in unfocused state, it is applicable for the bottom line and outline border when setting the container type as filled and outlined respectively.

    Declaration
    public static readonly BindableProperty UnfocusedStrokeWidthProperty
    Field Value
    Type
    Xamarin.Forms.BindableProperty

    Properties

    CharMaxLength

    Gets or sets the length of the maximum character value. When the character count reaches the character maximum length, the error color will be applied.

    Declaration
    public int CharMaxLength { get; set; }
    Property Value
    Type
    System.Int32

    ContainerBackgroundColor

    Gets or sets the background color of the container.

    Declaration
    public Color ContainerBackgroundColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color

    ContainerType

    Gets or sets a value that determines the appearance of background and its border.

    Declaration
    public ContainerType ContainerType { get; set; }
    Property Value
    Type
    ContainerType

    ControlTemplate

    Gets a value for template that specifies a group of styles and effects for controls.

    Declaration
    public ControlTemplate ControlTemplate { get; }
    Property Value
    Type
    Xamarin.Forms.ControlTemplate

    CounterLabelStyle

    Gets or sets the style for counter label.

    Declaration
    public LabelStyle CounterLabelStyle { get; set; }
    Property Value
    Type
    LabelStyle

    CurrentActiveColor

    Gets a value for current active color based on input view focus state.

    Declaration
    public Color CurrentActiveColor { get; }
    Property Value
    Type
    Xamarin.Forms.Color

    EnableFloating

    Gets or sets a value indicating whether to float the label when it is focused or unfocused.

    Declaration
    public bool EnableFloating { get; set; }
    Property Value
    Type
    System.Boolean

    EnableHintAnimation

    Gets or sets a value indicating whether to enable animation for the hint text when the input view is focused or unfocused.

    Declaration
    public bool EnableHintAnimation { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable hint animation; otherwise, false.

    EnablePasswordVisibilityToggle

    Gets or sets a value indicating whether to show the password visibility toggle.

    Declaration
    public bool EnablePasswordVisibilityToggle { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable password visibility toggle; otherwise, false.

    Remarks

    This property supports for Xamarin.Forms.Entry only.

    ErrorColor

    Gets or sets the color of the error text, line, and floating label text when setting error.

    Declaration
    public Color ErrorColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color

    ErrorLabelStyle

    Gets or sets the style for error label.

    Declaration
    public LabelStyle ErrorLabelStyle { get; set; }
    Property Value
    Type
    LabelStyle

    ErrorText

    Gets or sets the value for validation error. Error messages are displayed below the input line, replacing helper text until fixed.

    Declaration
    public string ErrorText { get; set; }
    Property Value
    Type
    System.String

    FocusedColor

    Gets or sets the color of the hint label and border when the control is focused.

    Declaration
    public Color FocusedColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color

    FocusedStrokeWidth

    Gets or sets as value to customize the stroke width in focused state, it is applicable for the bottom line and outline border when setting the container type as filled and outlined respectively.

    Declaration
    public double FocusedStrokeWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 2.

    HasError

    Gets or sets a value indicating whether it has validation errors. It determines the visibility of the error text.

    Declaration
    public bool HasError { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if has error; otherwise, false.

    HelperLabelStyle

    Gets or sets the style for helper label.

    Declaration
    public LabelStyle HelperLabelStyle { get; set; }
    Property Value
    Type
    LabelStyle

    HelperText

    Gets or sets a value for helper text in the input view. It conveys the additional information about the text in the input view.

    Declaration
    public string HelperText { get; set; }
    Property Value
    Type
    System.String

    Hint

    Gets or sets a value for hint text in the input view.

    Declaration
    public string Hint { get; set; }
    Property Value
    Type
    System.String

    HintLabelStyle

    Gets or sets the style for hint label.

    Declaration
    public LabelStyle HintLabelStyle { get; set; }
    Property Value
    Type
    LabelStyle

    InputView

    Gets or sets the value for input view to place behind the hint label.

    Declaration
    public View InputView { get; set; }
    Property Value
    Type
    Xamarin.Forms.View

    InputViewPadding

    Gets or sets desired padding to override default padding for input view.

    Declaration
    public Thickness InputViewPadding { get; set; }
    Property Value
    Type
    Xamarin.Forms.Thickness

    IsEnabled

    Gets or sets a value indicating whether users can interact with the control.

    Declaration
    public bool IsEnabled { get; set; }
    Property Value
    Type
    System.Boolean

    IsHintAlwaysFloated

    Gets or sets a value indicating whether to fix the hint label always at the top even when the text is empty.

    Declaration
    public bool IsHintAlwaysFloated { get; set; }
    Property Value
    Type
    System.Boolean

    LeadingView

    Gets or sets a value for a view to place before input view.

    Declaration
    public View LeadingView { get; set; }
    Property Value
    Type
    Xamarin.Forms.View

    LeadingViewPosition

    Gets or sets the value that determines whether to place the leading view within the layout.

    Declaration
    public ViewPosition LeadingViewPosition { get; set; }
    Property Value
    Type
    ViewPosition

    OutlineCornerRadius

    Gets or sets a value to customize the corner radius of outline border.

    Declaration
    public double OutlineCornerRadius { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 4.

    Remarks

    It is applicable only when set the container type as outlined.

    ReserveSpaceForAssistiveLabels

    Gets or sets a value indicating whether to allocate space for assistive labels. Assistive labels includes helper text, error text and character counter.

    Declaration
    public bool ReserveSpaceForAssistiveLabels { get; set; }
    Property Value
    Type
    System.Boolean
    Remarks

    When this property is set as false, space will be allocated based on the values of helper text, error text and character count labels.

    ShowCharCount

    Gets or sets a value indicating whether to display the character count when the value is changed.

    Declaration
    public bool ShowCharCount { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if enable counter; otherwise, false.

    ShowHelperText

    Gets or sets a value indicating whether to display the helper text. It determines the visibility of the helper text.

    Declaration
    public bool ShowHelperText { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show helper text; otherwise, false.

    ShowHint

    Gets or sets a value indicating whether to display the hint text.

    Declaration
    public bool ShowHint { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if show hint; otherwise, false.

    ShowLeadingView

    Gets or sets a value indicating whether to show or hide the leading view.

    Declaration
    public bool ShowLeadingView { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to show leading view; false to hide.

    ShowTrailingView

    Gets or sets a value indicating whether to show or hide the trailing view.

    Declaration
    public bool ShowTrailingView { get; set; }
    Property Value
    Type Description
    System.Boolean

    true to show trailing view; false to hide.

    TrailingView

    Gets or sets a value for a view to place after input view.

    Declaration
    public View TrailingView { get; set; }
    Property Value
    Type
    Xamarin.Forms.View

    TrailingViewPosition

    Gets or sets a value that determines whether to place the trailing view within the layout.

    Declaration
    public ViewPosition TrailingViewPosition { get; set; }
    Property Value
    Type
    ViewPosition

    UnfocusedColor

    Gets or sets the color of the hint label and border when the control is unfocused.

    Declaration
    public Color UnfocusedColor { get; set; }
    Property Value
    Type
    Xamarin.Forms.Color

    UnfocusedStrokeWidth

    Gets or sets as value to customize the stroke width in unfocused state, it is applicable for the bottom line and outline border when setting the container type as filled and outlined respectively.

    Declaration
    public double UnfocusedStrokeWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 1.

    Methods

    OnBindingContextChanged()

    Overridden. Raised when the binding context changed.

    Declaration
    protected override void OnBindingContextChanged()

    OnParentSet()

    To bind the flow direction property of parent with the RTL property in this view. The parent will be iterated until we get the flow direction value where the value is set other than match parent.

    Declaration
    protected override void OnParentSet()
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »