SfListView disable scrolling question

Hi,

I've a scenario when I need to disable SfListView scrolling and change it's TranslationY coordinates. Problem is that when  TranslationY changes it shows blank space at the bottom of the list, is there a way to fix this?

I've attached video to better demonstrate what is happening. Once calendar is visible I'm disabling scrolling in listview and then with pan gesture I move calendar and listview up as if closing. All working fine except the blank space.

Is there other way of doing this? Thanks in advance.


Attachment: ListView_Cutoff_d2b0372d.zip

3 Replies

LN Lakshmi Natarajan Syncfusion Team December 13, 2021 12:29 PM UTC

Hi Ernest, 
 
If scrolling is disabled, the scrollable container contains only the items that are visible in the view. Because the view cannot be scrolled, it displays white space at the bottom when panning. This is the expected behavior in Xamarin.Forms. Also, we have ensured this behavior in Xamarin.Forms ListView.  
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 



ER Ernest December 13, 2021 09:08 PM UTC

HI  Lakshmi,


Thank you. Is there any other way to stop ListView from scrolling while I perform pan gesture, perhaps keeping scroll Y coordinates locked somehow?



SV Suja Venkatesan Syncfusion Team December 14, 2021 03:16 PM UTC

Hi Ernest, 

If you are changing the Translation Y coordinates then the view cannot be scrolled, it displays white space at the bottom. Translation Y value have to change for applying animation. Translating an element outside the bounds of its parent container may prevent inputs from working. Please refer the following Documentation of Translation Y. 


You can achieve your requirement by adding both calendar and SfListview inside the ScrollView. While panning we have to set calendar visibility property as true and disable the inner ScrollView as like below code snippet. 

Code snippet: 
private void ToolbarItem_Clicked(object sender, EventArgs e) 
{ 
            calendar.IsVisible = true; 
            parentScrollView.InputTransparent = true; 
} 
 

We have attached a runnable sample based on your requirement for reference.  


Please have look at this sample and let us know if you have any concern. 

Regards, 
Suja. 
 


Loader.
Up arrow icon