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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Text Input Layout Error Height when using Character count

Thread ID:

Created:

Updated:

Platform:

Replies:

150318 Jan 2,2020 04:46 AM UTC Jan 6,2020 11:59 AM UTC Xamarin.Forms 3
loading
Tags: SfTextInputLayout
Mark
Asked On January 2, 2020 04:46 AM UTC

Hi,

I'm using the TextInputLayout around an entry field, and it's working brilliantly for the most part, however i've just found that when applying an error it's growing the height of the control unreasonably tall. See the screenshot below as an example, the two red boxes are in error state and have a lot more extra height before the line below them. 


If i remove the character count it seems to be better, although it still looks a little too high compared to the one without error:


Any idea what i might be doing wrong, or anything i can set to stop this from happening?

The controls are just in a bindable stacklayout.

Divya Venkatesan [Syncfusion]
Replied On January 2, 2020 04:04 PM UTC

Hi Mark, 
  
We have achieved your layout using Grid with TextInputLayouts inside StackLayout as shown in the below code snippet. We are not able to reproduce your issue while achieving this. 
  
Code snippet [Xaml]: 
  
    <StackLayout> 
        <BindableLayout.ItemsSource> 
            <ListCollection:List x:TypeArguments="x:String"> 
                <x:String>Item1</x:String> 
                <x:String>Item2</x:String> 
                <x:String>Item3</x:String> 
                <x:String>Item4</x:String> 
            </ListCollection:List> 
        </BindableLayout.ItemsSource> 
  
        <BindableLayout.ItemTemplate> 
            <DataTemplate> 
                <Grid> 
                    <Grid.ColumnDefinitions> 
                        <ColumnDefinition Width="*" /> 
                        <ColumnDefinition Width="3*" /> 
                    </Grid.ColumnDefinitions> 
                    <inputLayout:SfTextInputLayout 
                        BackgroundColor="Linen" 
                        ContainerType="Outlined" 
                        Hint="Rule Type"> 
                        <Entry Text="Contains" /> 
                    </inputLayout:SfTextInputLayout> 
                    <inputLayout:SfTextInputLayout 
                        Grid.Column="1" 
                        BackgroundColor="Linen" 
                        CharMaxLength="100" 
                        ContainerType="Outlined" 
                        ErrorText="Please enter value" 
                        HasError="True" 
                        Hint="Rule Value" 
                        ShowCharCount="True"> 
                        <Entry /> 
                    </inputLayout:SfTextInputLayout> 
                </Grid> 
            </DataTemplate> 
        </BindableLayout.ItemTemplate> 
    </StackLayout> 
  
Output Screenshot: 
 
  
  
Could you please check whether you can use this in your application? If not, please provide more details which would be helpful for us to assist you. 
  
Regards, 
Divya Venkatesan 
 


Mark
Replied On January 3, 2020 01:06 PM UTC

Thanks - because i have something hidden i prefer to use stacklayout with horizontal orientation. See the following code which is based on your example:

<StackLayout Padding="40">
                    <BindableLayout.ItemsSource>
                        <ListCollection:List x:TypeArguments="x:String">
                            <x:String>Item1</x:String>
                            <x:String>Item2</x:String>
                            <x:String>Item3</x:String>
                            <x:String>Item4</x:String>
                        </ListCollection:List>
                    </BindableLayout.ItemsSource>

                    <BindableLayout.ItemTemplate>
                        <DataTemplate>
                            <!--<Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="3*" />
                                </Grid.ColumnDefinitions>
                            </Grid>-->
                            <StackLayout Orientation="Horizontal">
                                <inputLayout:SfTextInputLayout 
                        BackgroundColor="Linen" 
                        ContainerType="Outlined" 
                        Hint="Rule Type">
                                    <Entry Text="Contains" />
                                </inputLayout:SfTextInputLayout>
                                <inputLayout:SfTextInputLayout 
                        Grid.Column="1" 
                                    HorizontalOptions="FillAndExpand"
                        BackgroundColor="Linen" 
                        CharMaxLength="100" 
                        ContainerType="Outlined" 
                        ErrorText="Please enter value" 
                        HasError="True" 
                        Hint="Rule Value" 
                        ShowCharCount="True">
                                    <Entry />
                                </inputLayout:SfTextInputLayout>
                            </StackLayout>
                        </DataTemplate>
                    </BindableLayout.ItemTemplate>
                </StackLayout>

And Screenshot:



Divya Venkatesan [Syncfusion]
Replied On January 6, 2020 11:59 AM UTC

Hi Mark, 
 
We are able to reproduce the issue when using StackLayout and we expect that this issue occurs in Xamarin.Forms Framework layout process while using certain layouts. Therefore, we recommend you to use Grid.  
 
If you are having any problems while using Grid, please let us know. We will assist you to sort out the problems. 
 
Regards, 
Divya Venkatesan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon