Fixed Hint Position in .NET MAUI Text Input Layout (SfTextInputLayout)

8 Jan 20253 minutes to read

Hint label for the text input layout is always fixed at the top position. This helps users make the hint label float even when the input view is not focused. It can be enabled by setting the IsHintAlwaysFloated property.

NOTE
The default value of the IsHintAlwaysFloated is false.

Filled

The hint label position of the input view will be set always at the top for the Filled container type.

<inputLayout:SfTextInputLayout Hint="Name"
                       IsHintAlwaysFloated="true" 
                       ContainerType="Outlined"
                       HelperText="Enter your name">
    <Entry />
</inputLayout:SfTextInputLayout>
var inputLayout = new SfTextInputLayout();
inputLayout.Hint = "Name";
inputLayout.IsHintAlwaysFloated = true;
inputLayout.ContainerType = ContainerType.Filled;
inputLayout.Content = new Entry();

.NET MAUI TextInputLayout with filled container type.

Outlined

The hint label position of the input view will be set always at the top for the Outlined container type.

<inputLayout:SfTextInputLayout Hint="Name"
                       IsHintAlwaysFloated="true" 
                       ContainerType="Outlined"
                       HelperText="Enter your name">
    <Entry />
</inputLayout:SfTextInputLayout>
var inputLayout = new SfTextInputLayout();
inputLayout.Hint = "Name";
inputLayout.IsHintAlwaysFloated = true;
inputLayout.ContainerType = ContainerType.Outlined;
inputLayout.Content = new Entry();

.NET MAUI TextInputLayout with outlined container type.

None

The hint label position of the input view will be set always at the top for the None container type.

<inputLayout:SfTextInputLayout Hint="Name"
                               IsHintAlwaysFloated="true" 
                               ContainerType="None"
                               HelperText="Enter your name">
    <Entry />
</inputLayout:SfTextInputLayout>
var inputLayout = new SfTextInputLayout();
inputLayout.Hint = "Name";
inputLayout.IsHintAlwaysFloated = true;
inputLayout.ContainerType = ContainerType.None;
inputLayout.Content = new Entry();

.NET MAUI TextInputLayout without container background.