Fixed Hint Position in .NET MAUI Text Input Layout (SfTextInputLayout)
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 theIsHintAlwaysFloated
isfalse
.
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="Filled">
<Entry />
</inputLayout:SfTextInputLayout>
var inputLayout = new SfTextInputLayout();
inputLayout.Hint = "Name";
inputLayout.IsHintAlwaysFloated = true;
inputLayout.ContainerType = ContainerType.Filled;
inputLayout.Content = new Entry();
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();
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();