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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AutoFitMode="Height" doesnt work using frame in datatemplate

Thread ID:





131431 Jul 9,2017 01:35 PM UTC Jul 10,2017 11:30 AM UTC Xamarin.Forms 2
Tags: SfListView
Asked On July 9, 2017 01:35 PM UTC

I am using frame inside datatemplate as show below, but this is not auto fitting for height, is there any limitation for frame or I do something wrong?

                        <sfListView:LinearLayout   />
                            <Frame  OutlineColor="Silver" HasShadow="True" Margin="5,0" Padding="1" BackgroundColor="Transparent" VerticalOptions="FillAndExpand">
                                <Grid    InputTransparent="True">
                                        <ColumnDefinition Width="2*"></ColumnDefinition>
                                        <ColumnDefinition Width="*"></ColumnDefinition>
                                        <RowDefinition Height="35"></RowDefinition>
                                        <RowDefinition Height="15"></RowDefinition>
                                        <RowDefinition Height="15"></RowDefinition>
                                        <RowDefinition Height="15"></RowDefinition>



Replied On July 9, 2017 11:54 PM UTC

when I add a margin as  5,5 which makes margin buttom and up as 5, then frame appears correctly if buttom and upper margin is 0, frame doesnt fit on screen

   <Frame  OutlineColor="Silver" HasShadow="True" Margin="5,5" Padding="1" BackgroundColor="Transparent" VerticalOptions="FillAndExpand">

Dinesh Babu Yadav [Syncfusion]
Replied On July 10, 2017 11:30 AM UTC

Hi Emil, 
Thank you for contacting Syncfusion Support. 
SfListView does not AutoFit the items when template is loaded within the Frame 
We have checked the reported issue “SfListView does not AutoFit the items when template is loaded within the Frame” at our end and we would like to let you know that if you define a size to element which is loaded in ItemTemplate property, then SfListView will returns that size as item size of each item. We have update this in our UG, for more information refer the below link, 

Also, in the given code snippet, you have defined a Height and Width for to the the ColumnDefintion and RowDefiniton in the Grid, so its doesn’t auto fit to content. So, we recommend you to define the Height and Width as “Auto”. Please refer the below sample, 

We have certain limitations while enabling the AutoFitMode and you can refer the following UG documentation link for more reference. 

Could you please check with the above sample and limitations in SfListView? If the issue still persist at your end, we request you to modify the above sample to replicate the reported issue and revert us with the replication procedure or in video link. So, that we could able to analyze the issue better and update you an appropriate solution. 

Defining Margin property within the ItemTemplate 
Instead of adjust the margin of element which defined in the ItemTemplate property, you use the ItemSpacing property of SfListView which generates the spacing around each item in the list as similar to Margin property. 
Please refer the following UG documentation link for more reference. 

Please let us know if you require further assistance. 
Dinesh Babu Yadav


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