Hi Pat,Thank you for using Syncfusion products.We have checked the reported query “Multiple SfListView inside a ScrollView is lagging in Android 10.0(Q) or API Level 29 - Q” from our side. We would like to inform you that when the ListView is loaded inside ScrollView, it is recommended to set the HeightRequest for the ListView. Please refer to our user guidance document regarding the same from the following link,UG link: https://help.syncfusion.com/xamarin/listview/working-with-sflistview#improving-listview-performanceAlso, we would like to inform you that, adding scrollable control like ListView inside the ScrollView is not recommended in Xamarin forms. The Xamarin.Forms warns the usage of nested ScrollView. You can refer to the following documentation regarding the same from the following links,If you still wants to add the SfListView control inside ScrollView, we suggest you to use IsScrollingEnabled as False or set HeightRequest for the ListView. Please refer the following code snippets regarding the same from the following link,We have attached the tested sample in the following link,Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ListViewXamarin-765454357If you still facing the issue please revert us with the following details which would be helpful for us to check on it and provide you the solution as soon as possible.
- Share ListView XAML page
- Share Issue reproducing video
- Share Syncfusion and Xamarin.Forms updated version
Regards,Lakshmi Natarajan
Hi Pat,Sorry for the inconvenience caused.We have checked the reported scenario at our side. We could reproduce the reported scenario with target version Android 10 – API 29. Also, the reported scenario occurs from the Xamarin.Forms version 4.5 and above. We are currently checking this in framework level. We will check completely and update you further details on January 20, 2021. We appreciate your patience until then.Lakshmi Natarajan
|
public interface IDependencyServiceListView
{
void SetNestedScrollingEnabled(SfListView ListView);
} |
|
[assembly: Dependency(typeof(ListViewDependencyService))]
namespace ListViewXamarin.Droid
{
public class ListViewDependencyService : IDependencyServiceListView
{
ExtendedScrollView ExtendedScrollView;
public void SetNestedScrollingEnabled(SfListView ListView)
{
#if __ANDROID_29__
ExtendedScrollView = ListView.GetScrollView();
var extendedScrollViewRenderer = Platform.GetRenderer(ExtendedScrollView);
extendedScrollViewRenderer.View.NestedScrollingEnabled = false;
#endif
}
}
} |
|
protected override void OnAppearing()
{
base.OnAppearing();
if (Device.RuntimePlatform == Device.Android)
{
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(listView1);
...
}
} |
|
<ScrollView>
<StackLayout>
<syncfusion:SfListView x:Name="listView1" ItemSize="50" IsScrollingEnabled="False" ItemsSource="{Binding ContactsInfo}" BackgroundColor="LightBlue">
<syncfusion:SfListView.ItemTemplate >
<DataTemplate>
<Grid x:Name="grid">
...
</Grid>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView> |
public void SetNestedScrollingEnabled(SfListView ListView) { #if __ANDROID_29__ ExtendedScrollView = ListView.GetScrollView(); var extendedScrollViewRenderer = Platform.GetRenderer(ExtendedScrollView); if (extendedScrollViewRenderer == null) { extendedScrollViewRenderer = Platform.CreateRenderer(ExtendedScrollView); Platform.SetRenderer(ExtendedScrollView, extendedScrollViewRenderer); } extendedScrollViewRenderer.View.NestedScrollingEnabled = false; #endif
Hi Pat,Thank for the update.#Regarding Multiple SfListView inside a ScrollView is lagging in Android 10.0(Q) or API Level 29 - QWe are currently working on it and update you further details on January 27, 2020. We appreciate your patience until then.Regards,SaiGanesh Sakthivel
|
private void listView_Loaded(object sender, ListViewLoadedEventArgs e)
{
if (Device.RuntimePlatform == Device.Android)
{
DependencyService.Get().SetNestedScrollingEnabled((sender as SfListView));
}
} |
Hi Pat,Thank you for the update.We are glad that your requirement has been met at your side.Meanwhile, we would like to inform you that the ItemAppearing event will be triggered for every item while loading in the view. Please refer to our user guidance document for the same,We suggest you to try the Loaded event instead of ItemAppearing to achieve your requirement. The Loaded event will be raised after the SfListView is loaded in view for the first time. You can trigger the Loaded event for each ListView loaded in the page and call the SetNestedScrollingEnable method.Please refer to the user guidance document from the following link,Please refer to the following code snippets,
private void listView_Loaded(object sender, ListViewLoadedEventArgs e){if (Device.RuntimePlatform == Device.Android){DependencyService.Get().SetNestedScrollingEnabled((sender as SfListView));}}Please let us know if this works without exception?Lakshmi Natarajanpage one side of one leaf (of a book or magazine or newspaper or letter etc.) or the written or pictorial matter it contains More (Definitions, Synonyms, Translation)
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:ListViewXamarin"
xmlns:syncfusion="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
x:Class="ListViewXamarin.MainPage">
<ContentPage.BindingContext>
<local:ContactsViewModel/>
</ContentPage.BindingContext>
<ContentPage.Behaviors>
<local:Behaviors/>
</ContentPage.Behaviors>
<ContentPage.Content>
<ScrollView>
<StackLayout>
<syncfusion:SfListView x:Name="listView1" ItemSize="50" IsScrollingEnabled="False" ItemsSource="{Binding ContactsInfo}" BackgroundColor="LightBlue">
<syncfusion:SfListView.ItemTemplate >
<DataTemplate>
...
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
... |
|
public class Behaviors : Behavior<ContentPage>
{
SfListView ListView1;
SfListView ListView2;
SfListView ListView3;
SfListView ListView4;
SfListView ListView5;
protected override void OnAttachedTo(ContentPage bindable)
{
ListView1 = bindable.FindByName<SfListView>("listView1");
ListView2 = bindable.FindByName<SfListView>("listView2");
ListView3 = bindable.FindByName<SfListView>("listView3");
ListView4 = bindable.FindByName<SfListView>("listView4");
ListView5 = bindable.FindByName<SfListView>("listView5");
ListView1.Loaded += ListView1_Loaded;
base.OnAttachedTo(bindable);
}
private void ListView1_Loaded(object sender, ListViewLoadedEventArgs e)
{
if (Device.RuntimePlatform == Device.Android)
{
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(ListView1);
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(ListView2);
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(ListView3);
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(ListView4);
DependencyService.Get<IDependencyServiceListView>().SetNestedScrollingEnabled(ListView5);
}
}
} |