Articles in this section
Category / Section

How to vertically center align icons in leading and trailing views in Xamarin TextInputLayout?

1 min read

You can align the icons in leading and trailing view vertically centered by setting VerticalTextAlignment property of Label as Center.

 

Code snippets [Xaml]:

<inputLayout:SfTextInputLayout ContainerType="Outlined" Hint="Date"     
                                       UnfocusedStrokeWidth="2"
                                       LeadingViewPosition="Inside" OutlineCornerRadius="20">
            
            <inputLayout:SfTextInputLayout.LeadingView>
                <Label VerticalTextAlignment="Center" Text="&#x1F5D3;" FontSize="16"/>
            </inputLayout:SfTextInputLayout.LeadingView>
 
            <Entry />
 
        </inputLayout:SfTextInputLayout>

 

Output:

 

TextInputLayout LeadingView alignment

 

View the sample in GitHub

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied