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

Putting the label on top of the entry, above the border

Hi,

SfTextInputLayout is great. It has so many options for customization. However, our design needs the label to be on top of the entry border, as in the below image and I couldn't find a way to achieve this.


Is this possible? Am I missing something?


Thanks in advance,


Sinan


3 Replies 1 reply marked as answer

ET Eswaran Thirugnanasambandam Syncfusion Team November 24, 2022 05:52 AM

SfTextInputLayout control doesn’t have default support to place the label on top of the container. As per material design guidelines, you can only place the label inside the control on the top left position as a hint as shown in the below image



You can achieve this by setting the IsHintAlwaysFloated as true which will make the Hint label for the text input layout is fixed always at the top position. Please find the below documentation for more information

https://help.syncfusion.com/xamarin/text-input-layout/fixed-hint-position


Also, your requirement can be achieved without a hint label by placing a label and text input layout inside the StackLayout. We have prepared the sample for this and attached the same below. 


Attachment: SfTextInputLayout_b1d1b45.zip

Marked as answer

OS Osman Sinan Guven November 24, 2022 08:25 AM

Hi Eswaran,

Thanks for the reply. I was kind of hoping for a solution integrated in SfTextInputLayout. Otherwise, I have to maintain your solution custom control where I have to propagate each and every property that I need in SfTextInputLayout to my custom control. But, I see that it is not possible. Thanks again for the prompt reply and the sample.


Sinan



VO Vishal Omprasad Syncfusion Team November 25, 2022 06:44 AM

Please let us know if you need any further assistance on SfTextInputLayout control.


Loader.
Live Chat Icon For mobile
Up arrow icon