SFlistview performance issue on android

hi all,

i'm using SFList with grid layout in order to have a grid based on screen width and with an avg of items of 30.

I'm using a Data template since i have diferent item style (some have just label, other sfbutton, other sfgauge ecc)

On IOS everything is good but on android i have performance issue event if i'm using a very good phone (oneplus 8).

what i can do in order to speedup? on tablet the issue is more visible. i alredy tryed to optimize everything but i'm not happy. there is a big gap between ios and andorid performce and it is not accetable.

the scroll isn't fluid.

thanks


26 Replies

LU Luca December 13, 2021 11:43 AM UTC

maybe doing this the performace will improve since i'm loading everything one shot?

The SfListView will load all of its items by setting the IsScrollingEnabled property to false and put it into a scrollview.

what do you think?



LU Luca December 13, 2021 07:53 PM UTC

hi all,

yes i can say that appliyng  IsScrollingEnabled="False" and put the listview inside a scrollview is the best solution. now the performance are incredible on both platform. i think this should be the default approch with listview if we don't have thoundes of items.

what do you think? thanks



LU Luca December 14, 2021 09:35 AM UTC

Unfortunately i found a bug on android with ItemsListView.LayoutManager = gridLayout;

Using IsScrollingEnabled="False" and put the listview inside a scrollview i'm not able to filter items.

Seems that items are loaded (i have an ObservableCollection that isn't empty) but they are not displayed.

this happens only when the result of the filter are few elements (eg 1-2). when i filter and the result are many i can see them.

With filtering i mean change the element in ItemsSource="{Binding Items}" in the viewmodel

if i rollback to IsScrollingEnabled="true" and i remove the scrollview everyrhing works.

can you help me please?


the layout of the page is:

<AbsoluteLayout

<Grid AbsoluteLayout.LayoutBounds="0,0,1,1"    AbsoluteLayout.LayoutFlags="All"

<Grid.ColumnDefinitions>

                    <ColumnDefinition Width="*" />

                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>

                    <RowDefinition Height="auto" />

                    <RowDefinition Height="auto" />

                    <RowDefinition Height="auto" />

                    <RowDefinition Height="*" />

                </Grid.RowDefinitions>


<ScrollView Grid.Row="3" Grid.Column="0" VerticalScrollBarVisibility="Never" HorizontalScrollBarVisibility="Never">

                    <slistview:SfListView IsScrollingEnabled="False" ItemSize="120" Orientation="Vertical"




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

Hi Luca, 

Please find the response for the each reported issues. 

Regarding  issue “Filtering issue when IsScrollingEnabled=False or SfListView inside a scrollview” 
We are unable to reproduce the reported in simple sample when IsScrollingEnabled as False and SfListView inside the ScrollView. Filtering in SfListView works fine as expected in our end. The sample we have used to the reported issue is attached here. 


Please have a look at this sample and let us know if we have missed any customization you have done in your application or revert us with modified sample. Kindly please share the below requested detail. 
  • Xamarin.Forms and SfListView control version.
  • Video/Image illustration of the reported issue.

Additional Information: 
Tested device:    
Android: Physical device- Samsung S8+(Android 9.0- API 28)  
SfListView version: 19.3.0.57 
Xamarin.Forms version:4.5.0.617 


Regarding “Performance issue on Android” 

Please refer our User Guidelines Documentation of improving performance on SfListView in the following link. 





Regards, 
Suja. 

 



LU Luca December 15, 2021 12:12 AM UTC

finally (after hours) i found the issue.

if you add to SfListView ItemSpacing="0,0,10,10" then the app breaks if you filter on 3 items as example.

i uploaded an example based on yours, use the SfSegmentedControl in order to filter.

thanks


Attachment: GettingStarted_916ad799.zip


LN Lakshmi Natarajan Syncfusion Team December 15, 2021 03:15 PM UTC

Hi Luca, 
 
When setting WidthRequest for ListView in the OnSizeAllocated method, along with bottom ItemSpacing, the reported scenario occurs. It is also not recommended to manually set the HeightRequest/WidthRequest for ListView when IsScrollingEnabled is set to False. 
 
As a result, we recommend that you not to set WidthRequest in the OnSizeAllocated method if it is unnecessary, or you can avoid the reported scenario by removing the bottom ItemSpacing for ListView and handling the padding in the ItemTemplate for the same. 
 
Please let us know if you have any concerns.   
 
Regards, 
Lakshmi Natarajan 



LU Luca December 15, 2021 04:04 PM UTC

hi,

thanks fot yor answer, i did exactly the same, adding padding in the item template.

my goal is to have item as square, 100x100 as example and put a padding of 5 pixel between them.

the number of columns depends on screen size. 

the problem is that without adding the widhtrequest the list take all the Width of the screen and the padding between items is more than the padding i put




LN Lakshmi Natarajan Syncfusion Team December 16, 2021 01:16 PM UTC

Hi Luca, 
 
We suggest you to customize the spacing using Padding in the ItemTemplate to achieve your requirement. Please refer to the following code snippets for more reference, 
 
<ScrollView x:Name="scroll" Grid.Row="3" Grid.Column="0" VerticalScrollBarVisibility="Never" HorizontalScrollBarVisibility="Never"> 
    <sync:SfListView x:Name="listView"  
                IsScrollingEnabled="False" 
ItemsSource="{Binding BookInfo}" HorizontalOptions="StartAndExpand"  
ItemSize="120"> 
        <sync:SfListView.ItemTemplate> 
            <DataTemplate> 
                <Grid Padding="0,0,10,10" > 
                    <Grid.RowDefinitions> 
                        <RowDefinition Height="0.4*" /> 
                        <RowDefinition Height="0.6*" /> 
                    </Grid.RowDefinitions> 
                    <Label x:Name="label" Text="{Binding BookName}" FontSize="21" FontAttributes="Bold"/> 
                    <Label Grid.Row="1" Text="{Binding BookDescription}" FontSize="15"/> 
                </Grid> 
            </DataTemplate> 
        </sync:SfListView.ItemTemplate> 
    </sync:SfListView> 
</ScrollView> 
 
Please let us know if this helps. 
 
Regards, 
Lakshmi Natarajan


LU Luca December 17, 2021 12:35 AM UTC

hi,

i'm doing exactly this, adding padding in the item template but i'm also setting the width of the list in

OnSizeAllocated otherwise this padding isn't respected.

Anyway doing this i have the same bug, sometimes based on the item numbers the items

disappear.

the list works just only if i remove, as you said, the width of the list in OnSizeAllocated but doing that the items are distruited equally based on listview that is equal to screen view, so if i have two items for row, the width of the list is split equally in two part and they don't follow the padding i added.

what i'm doing wrong?

this happens on android 8, on 11 it's working properly.....

below an example

thanks


TEST.png



LN Lakshmi Natarajan Syncfusion Team December 18, 2021 11:28 AM UTC

Hi Luca, 
 
We have tested the sample in Pixel 5 (Android 8 – API 26) and Vivo V7 plus (Android 8.1 - API 27) device and the ListView works fine as expected. Please find the tested sample and output in the following link, 
 
 
Screenshot 
 
Please check our sample and let us know if you still facing the same issue? If not, please modify our sample and revert us back with the following details which will be helpful for us to check on in and provide you the solution as soon as possible. 
  • Share issue replication video
  • Share tested device details
 
Lakshmi Natarajan 
 



LU Luca January 14, 2022 02:12 PM UTC

hi all,

on IOS i have this issue now. The same on android but without exception. This happens just on some specific count of item in the list and only if i set ItemsListView.WidthRequest

. Can you help me? thanks

Foundation.MonoTouchException: 'Objective-C exception thrown. Name: CALayerInvalidGeometry Reason: CALayer bounds contains NaN: [0 nan; 390 inf]. Layer: ; layer = ; contentOffset: {0, 0}; contentSize: {390, 390}; adjustedContentInset: {0, 0, 0, 0}>; sublayers = (, , ); masksToBounds = YES; allowsGroupOpacity = YES; anchorPoint = CGPoint (0.5 0.5); backgroundColor = [ (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1; extended range)] ( 1 1 1 0 )>

Native stack trace:

0 CoreFoundation 0x0000000180409110 16FAA70C-278C-3561-859E-CEC407C2DC7C + 626960

1 libobjc.A.dylib 0x0000000198c43d64 objc_exception_throw + 60

2 CoreFoundation 0x0000000180460230 16FAA70C-278C-3561-859E-CEC407C2DC7C + 983600

3 QuartzCore 0x00000001840ea988 0594369D-11DD-39D9-A981-74984F490C0C + 145800

4 QuartzCore 0x000000018418dfcc 0594369D-11DD-39D9-A981-74984F490C0C + 815052

5 UIKitCore 0x00000001829843e4 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1496036

6 UIKitCore 0x0000000182991060 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1548384

7 UIKitCore 0x0000000182995030 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1564720

8 UIKitCore 0x0000000182add2d4 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 2908884

9 UIKitCore 0x00000001829d34c8 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1819848

10 TestApp.iOS 0x00000001044b45b0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 56613640

11 TestApp.iOS 0x0000000103dfa3a4 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 49559804

12 TestApp.iOS 0x0000000104bfcaf8 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 64249936

13 TestApp.iOS 0x0000000104a65fbc GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 62584084

14 TestApp.iOS 0x0000000104a66594 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 62585580

15 TestApp.iOS 0x0000000104a64c84 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 62579164

16 TestApp.iOS 0x0000000101d04a5c GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 14999476

17 TestApp.iOS 0x0000000101d008a8 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 14982656

18 TestApp.iOS 0x0000000101d06508 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 15006304

19 TestApp.iOS 0x0000000105ed46a8 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 84007936

20 TestApp.iOS 0x0000000101bd9048 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13772192

21 TestApp.iOS 0x0000000101bd8380 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13768920

22 TestApp.iOS 0x0000000105ed5804 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 84012380

23 TestApp.iOS 0x0000000101d081b8 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 15013648

24 TestApp.iOS 0x0000000101d0c0cc GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 15029796

25 TestApp.iOS 0x0000000101d0088c GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 14982628

26 TestApp.iOS 0x0000000101d06508 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 15006304

27 TestApp.iOS 0x0000000101bd7ab4 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13766668

28 TestApp.iOS 0x0000000101c547ec GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 14277956

29 TestApp.iOS 0x0000000101bd9048 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13772192

30 TestApp.iOS 0x0000000101bd8380 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13768920

31 TestApp.iOS 0x0000000101d081b8 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 15013648

32 TestApp.iOS 0x0000000101bdb0c0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 13780504

33 TestApp.iOS 0x0000000104a607a0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 62561528

34 TestApp.iOS 0x0000000104a60964 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 62561980

35 TestApp.iOS 0x00000001019735e0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 11258680

36 TestApp.iOS 0x0000000108a820a0 mono_pmip + 28172

37 TestApp.iOS 0x0000000108b3c7fc mono_pmip + 791912

38 TestApp.iOS 0x0000000108b4003c mono_pmip + 806312

39 TestApp.iOS 0x0000000100fb5d20 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 1045112

40 TestApp.iOS 0x0000000100fb5c30 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 1044872

41 UIKitCore 0x00000001829a4798 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1628056

42 QuartzCore 0x0000000184107138 0594369D-11DD-39D9-A981-74984F490C0C + 262456

43 QuartzCore 0x00000001840f9958 0594369D-11DD-39D9-A981-74984F490C0C + 207192

44 QuartzCore 0x000000018410df80 0594369D-11DD-39D9-A981-74984F490C0C + 290688

45 QuartzCore 0x0000000184116874 0594369D-11DD-39D9-A981-74984F490C0C + 325748

46 UIKitCore 0x00000001829b37e4 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1689572

47 UIKitCore 0x0000000182983584 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1492356

48 UIKitCore 0x00000001829886fc CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 1513212

49 CoreFoundation 0x000000018042b0d0 16FAA70C-278C-3561-859E-CEC407C2DC7C + 766160

50 CoreFoundation 0x000000018043bd90 16FAA70C-278C-3561-859E-CEC407C2DC7C + 834960

51 CoreFoundation 0x0000000180376098 16FAA70C-278C-3561-859E-CEC407C2DC7C + 24728

52 CoreFoundation 0x000000018037b8a4 16FAA70C-278C-3561-859E-CEC407C2DC7C + 47268

53 CoreFoundation 0x000000018038f468 CFRunLoopRunSpecific + 600

54 GraphicsServices 0x000000019bf1a38c GSEventRunModal + 164

55 UIKitCore 0x0000000182d31088 CD7F7BA2-A2C6-3727-AFF6-9BAAB60CC6AB + 5349512

56 UIKitCore 0x0000000182aaf958 UIApplicationMain + 2092

57 TestApp.iOS 0x000000010448b488 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 56445408

58 TestApp.iOS 0x0000000103d68cf0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 48964168

59 TestApp.iOS 0x000000010109dcf0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 1995336

60 TestApp.iOS 0x00000001019735e0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 11258680

61 TestApp.iOS 0x0000000108a820a0 mono_pmip + 28172

62 TestApp.iOS 0x0000000108b3c7fc mono_pmip + 791912

63 TestApp.iOS 0x0000000108b42ab0 mono_pmip + 817180

64 TestApp.iOS 0x0000000108a604b0 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 129669640

65 TestApp.iOS 0x0000000108c45ec4 xamarin_get_original_working_directory_path + 3668

66 TestApp.iOS 0x000000010109bda4 GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth + 1987324

67 dyld 0x0000000109d69aa4 start + 520

'




SV Suja Venkatesan Syncfusion Team January 17, 2022 02:33 PM UTC

Hi Luca, 

Currently, we are validating the reported issue in our end. We will update you the further detail on or before January 19, 2022. We appreciate your patience until then. 

Regards, 
Suja 



LN Lakshmi Natarajan Syncfusion Team January 19, 2022 11:37 AM UTC

Hi Luca, 
 
We have checked our sample in iPhone 12 Pro Max – 14.4 simulator and we are unable to replicate the reported scenario on our side.  
 
Please find the tested sample in the following link, 
 
Please modify our sample to replicate the issue and revert us back with the following details, 
  • Share issue replication video
  • Share tested device details
  • Share Syncfusion and Xamarin.Forms versions
 
It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards, 
Lakshmi Natarajan 



LU Luca January 19, 2022 11:55 AM UTC

hi, thanks for yor reply.

I think the problem is that you are using a simulator (i'm using a real one with ios 15.2).

anyway i'm going to edit your project.

thanks a lot



LN Lakshmi Natarajan Syncfusion Team January 20, 2022 09:25 AM UTC

Hi Luca, 
 
Please test this at your end and let us know if you require any further assistance on this. We will be happy to assist you. 
 
Lakshmi Natarajan 



LU Luca February 21, 2022 10:26 PM UTC

hi all,

on Android using  IsScrollingEnabled="False" let the scroll slow. I mean, if i scroll it scrolls just 3 rows. Is there a way to increase the speed?

ON ios with a scrool i'm able to reach the end even if i have many items.

thanks



LN Lakshmi Natarajan Syncfusion Team February 22, 2022 01:02 PM UTC

Hi Luca, 
 
You can overcome the reported scenario by setting the NestedScrollingEnabled as False in sample level to disable the nested scrolling. Please refer to the following answer to achieve your requirement, 
 
 
Please let us know if you need further assistance.  
 
Lakshmi Natarajan 
 



LU Luca February 22, 2022 07:56 PM UTC

amazing! thanks, it works!

regarding the initial issue, is still present but i'm not able to share with you.

i'm still receiving message from users that using the segmented as filter and causing the exception.

i'm trying to replicate but on simulator works, seems that rhe issue happens just on real device.

i don't know hot to share with you but still present.


A new one issue is that, if i put a chart in the item, the ones that appear after scroll aren't update. i'm going to check deeper. thanks



LN Lakshmi Natarajan Syncfusion Team February 23, 2022 11:08 AM UTC

Hi Luca, 
 
Please test this at your end and let us know if you require any further assistance on this. 
 
Note: If you have any concerns about sharing files in a public forum, you can create a separate ticket and share the sample with us. As always, we will be happy to assist you. 
 
Lakshmi Natarajan 
 



LU Luca February 25, 2022 07:41 PM UTC

hi,

about NestedScrollingEnabled, i'm setting in the page constructor and it work BUT if i change the tab and then come back it doesn't work anymore. Seems that the list loose the property.

In order to let it work i put the code in  OnSizeAllocated method.

Do you have a better idea?

thanks




LN Lakshmi Natarajan Syncfusion Team February 28, 2022 01:47 PM UTC

Hi Luca, 
 
You can use the dependency method to update the NestedScrollingEnabled property in the page's OnAppearing override, as suggested in this reply. This method will be called immediately before the page becomes visible. 
 
Please refer to the following documentation regarding OnAppearing method, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
  
 



LU Luca February 28, 2022 02:29 PM UTC

hi,

finally i'm able to replicate the issue!

so run the code (the one attached that is more or less your previous example)

filter on 7 in order to see just 7 items and the issue happens.

i put  <ColumnDefinition Width="375" /> ​because in my real app this is the space available on a iphone pro 13 where i get the issue. fixing this value also on android i'm able to get the issue also on this platform.

IOS: the app crash and gives me the exception below

ANdorid: nothing is diplayed and no exceptions

let me know

thanks


Detail:

System.ArgumentException: 'NaN is not a valid value for height'

{System.ArgumentException: NaN is not a valid value for height at Xamarin.Forms.Size..ctor (System.Double width, System.Double height) [0x0001b] in D:\a\1\s\Xamarin.Forms.Core\Size.cs:22 at Xamarin.Forms.Rectangle.get_Size () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Rectangle.cs:189 at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.View child, Xamarin.Forms.Rectangle region, Xamarin.Forms.SizeRequest childSizeRequest) [0x00055] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:259 at Xamarin.Forms.StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00081] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:65 at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:203 at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:876 at Xamarin.Forms.VisualElement.SetSize (System.Double width, System.Double height) [0x00021] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:1108 at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle value) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:415 at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle bounds) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:785 at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x001da] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:157 at Xamarin.Forms.ScrollView.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x000f8] in D:\a\1\s\Xamarin.Forms.Core\ScrollView.cs:237 at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:203 at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:876 at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x00069] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:374 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].ResolveLayoutChanges () [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:320 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].LayoutSubviews () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:332 at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:73 at test.iOS.Application.Main (System.String[] args) [0x00001] in D:\Dev\test\test\test.iOS\Main.cs:17 }



Attachment: ListViewXamarin_(2)_c2ba37ff.zip


LU Luca March 3, 2022 10:14 PM UTC

hi all,

just to know if you are able to replicate the issue above, thanks.



LN Lakshmi Natarajan Syncfusion Team March 4, 2022 01:10 PM UTC

Hi Luca, 
 
You can overcome the reported scenario by setting the WidthRequest to the StackLayout as mentioned below, 
 
<AbsoluteLayout> 
    <StackLayout WidthRequest="375"> 
        <Grid x:Name="mainGrid" Padding="10,0,5,0" AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All"> 
            <Grid.RowDefinitions> 
                <RowDefinition Height="auto" /> 
                <RowDefinition Height="auto" /> 
                <RowDefinition Height="auto" /> 
                <RowDefinition Height="*" /> 
            </Grid.RowDefinitions> 
            <SearchBar x:Name="filterText" HeightRequest="40" 
    Placeholder="Search here to filter" 
    TextChanged="OnFilterTextChanged" Grid.Row="0"/> 
 
            <syncfusion:SfSegmentedControl Grid.Row="1"  x:Name="scFilter" SegmentHeight="30"   
    VisibleSegmentsCount="5"  
    Color="Transparent" 
                                        SelectedIndex="{Binding SelectedFilterIndex}"> 
                 
            </syncfusion:SfSegmentedControl> 
 
 
            <ScrollView x:Name="scroll" Grid.Row="3" Grid.Column="0" VerticalScrollBarVisibility="Never" HorizontalScrollBarVisibility="Never"> 
                <sync:SfListView x:Name="listView"  
                        IsScrollingEnabled="False" 
                            BackgroundColor="DarkGoldenrod" 
        ItemsSource="{Binding BookInfo}" HorizontalOptions="StartAndExpand"  
        ItemSize="125" > 
                    
                </sync:SfListView> 
            </ScrollView> 
        </Grid> 
    </StackLayout> 
</AbsoluteLayout> 
 
We have attached the modified sample in the following link, 
 
Please let us know if you need further assistance. 
 
Lakshmi Natarajan 
 



LU Luca March 4, 2022 06:48 PM UTC

hi,

thanks for your answer but the question is a little bit difference.

I mean, the listview is going to take all the space and on a iphone pro 13 is 375 (i'm not setting the widht to 375, 375 is the space available).

So the question is: why is there this issue?

On different device i will get different space (not always 375), how can i be sure that it will work?

there is something in your library that breaks when is 375.

now in order to put a stupid fix i decrease the padding of 1 in order to have 376 and it's working.

thanks



LN Lakshmi Natarajan Syncfusion Team March 7, 2022 03:20 PM UTC

Hi Luca, 
 
Based on the stack trace, the crash does not throw at our source level. Instead, the exception is thrown by the Xamarin.Forms.Core assembly. Hence, we suggest you use the sample level solution to overcome the reported scenario.  
 
Please test your application by loading the Grid inside the StackLayout as we have mentioned in our previous update and let us know if this helps. 
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon