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

SfListView displays empty space under the last item

Thread ID:





140956 Nov 15,2018 05:27 PM UTC Nov 20,2018 05:18 AM UTC Xamarin.Forms 3
Tags: SfListView
Weronika Ziarkowska
Asked On November 15, 2018 05:27 PM UTC


On the previous version of SfListView, unless I declared fixed size of the listview it autosized depending on the size of element displayed. However, after I updated to the newest version (, by default it displays all items and a huge blank space underneath them. Is there a way to correctly autosize listview? 

Weronika Ziarkowska

Jayaleshwari N [Syncfusion]
Replied On November 16, 2018 07:12 AM UTC

Hi Weronika,   
Thanks for Contacting Syncfusion Support. 
We have checked the reported query “SfListView displays empty space under the last item” from our side.  We would like to know that we have modified the behavior of SfListView when loaded inside layouts such as Grid, StackLayout and ScrollView. In these layouts, the SfListView works similar to Xamarin.Forms ListView. We have already mentioned regarding this in our release notes and you can refer the same from the below link.  
We would like to inform that the SfListView measures and allocates size only when its parent element calls for Measure to calculate the size of the child element(i.e., In this case SfListView) to render in the View. When RowDefinition is ‘*’, SfListView OnMeasure won’t be called from its parent element Grid. Same thing applies for StackLayout when loaded in Grid ‘*’ RowDefinition. So even when we define HeightRequest for SfListView, it will be ignored.  
So if you want to load the SfListView in exact height as its extent, load it inside Grid ‘Auto’ RowDefinition and set its TotalExtent to its HeightRequest as below.   
We have updated this in UG documentation also. You can refer from the following location.  
We have attached the tested sample for your reference and you can download the same from the following location.   
Please let us know if you would require further assistance.  
Jayaleshwari N.  

Weronika Ziarkowska
Replied On November 19, 2018 11:10 AM UTC


Thank you for your answear, the provided sample helped me solve my issue. Is there a way to declare behaviors for SfListView in c# and not in xaml?

Weronika Ziarkowska

Jayaleshwari N [Syncfusion]
Replied On November 20, 2018 05:18 AM UTC

Hi Weronika, 
Thanks for the update. 
We have checked the query regarding “Declare behaviors for SfListView in C#” from our side. You can achieve your requirement by adding the defined listview behavior in ListView.Behaviors collection. 
public MainPage() 
    listView.Behaviors.Add(new ListViewBehavior()); 
We have attached the modified sample for your reference and you can download the same from the following location. 
Please let us know if this solution meets your requirement. 
Jayaleshwari N. 


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