We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Keep Hint text from appearing at top of field when user enters text

I am trying to build a style for SfTextInput that will have Hint text in the field but I don't want the Hint text to move to the top of the field when the user starts to enter text (I would like the hint text to go away once a user enters text but reappear if the user clears the field). I have pasted in my test code and two images.

    <StackLayout x:Name="InputContainer" VerticalOptions="StartAndExpand" Padding="10, 0, 10, 0">
        <inputLayout:SfTextInputLayout x:Name="TextInputLayout" Style="{DynamicResource SfTextInputStyle}" Hint="Enter Your Answer" IsHintAlwaysFloated="False">
            <Editor x:Name="TextInput" TextChanged="TextChanged" Unfocused="TextInputUnfocused" AutoSize="TextChanges" />

Thanks for your help,

Brian Swanson

Attachment: Archive_a02acfa4.zip

3 Replies

RA Rachel A Syncfusion Team December 16, 2019 05:34 AM UTC

Hi Brian, 
Greetings from Syncfusion. 
We can retain the position of the hint text inside the container itself by setting EnableFloating property as false same as in the below code snippet. 
  <textinputlayout:SfTextInputLayout EnableFloating="False" Hint="Type Text"> 
        <Entry ></Entry> 
For more information on hint text, refer the below documentation link. 

BS Brian Swanson December 16, 2019 04:15 PM UTC


Thank you. That worked.

- Brian

LR Lakshmi Radha Krishnan Syncfusion Team December 17, 2019 05:49 AM UTC

Hi Brian,

We are glad that the provided solution works.

Lakshmi R.

Live Chat Icon For mobile
Up arrow icon