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

HintText Padding center with Entry

I need center the Entry view between the HintText and Line (Border) of the TextInputLayout.
Example follows attach.

Attachment: PaddingHintText_c06f7a6f.zip

1 Reply

LR Lakshmi Radha Krishnan Syncfusion Team August 7, 2019 06:00 PM UTC

Hi Laerte,


Greetings from Syncfusion.

 

As per the material design specification, we have positioned the input view based on the ContainerType property. But you may adjust the input view of the SfTextInputLayout to the center of the hint label and border line using the InputViewPadding property. Please refer the below code snippet.

UG Link: https://help.syncfusion.com/xamarin/sftextinputlayout/container-type#custom-padding

 

Code Snippet:

<inputLayout:SfTextInputLayout x:Name="inputLayout" Hint="Senha" ContainerType="None">
            <inputLayout:SfTextInputLayout.InputViewPadding>
                 <OnPlatform x:TypeArguments="Thickness"
                                                        iOS="0,20,0,7"
                                                        Android="0,20,0,15"
                                                        WinPhone="0,20,0,15" />
            </inputLayout:SfTextInputLayout.InputViewPadding>
            <Entry Text="12345" x:Name="entry"/>
 </inputLayout:SfTextInputLayout>

 

By default, input view positioned at center for the other ContainerType (Filled and Outlined) property. So, you may set the above container type to position at center.
  

Please let us know if your requirement is different from this.

Regards,

Lakshmi R.

 


Loader.
Up arrow icon