Xamarin.forms: [Bug] [iOS] CollectionView: RemainingItemsThreshold feature does not work on iOS with Grouped collection view

Created on 11 May 2020  路  4Comments  路  Source: xamarin/Xamarin.Forms

Description

On iOS, we are having an issue with the CollectionView when used with IsGrouped = true, the feature of RemainingItemsThreshold and RemainingItemsThresholdCommand does not seem to work even though working fine in Android.

Similarly in Android (as I could not test in iOS), the ItemsUpdatingScrollMode = KeepScrollOffset does not work all the time as it keeps switching position to the first response's (Page 1) end of the list/collection as it reaches the Threshold and appends to the List.

Steps to Reproduce

  1. Create a CollectionView with Grouped Header/Content.
  2. Apply the RemainingItemsThreshold =5 and RemainingItemsThresholdCommand as Binding with Load more logic.
  3. You can see that, as the scroll reaches the bottom of the list (or when there are 5 items to display) it does not do anything.

Expected Behavior

The CollectionView's RemainingItemsThreshold logic should work and request the remaining content (Load more) from the service.

Actual Behavior

At present in iOS, the RemainingItemsThreshold implementation does not do anything. Only the first page data being displayed, even though Android has the logic working perfectly.

<CollectionView x:Name="collectionView"
                                AbsoluteLayout.LayoutBounds="0,0,1,1"
                                AbsoluteLayout.LayoutFlags="All"
                                BackgroundColor="Transparent"
                                IsGrouped="True"
                                ItemSizingStrategy="MeasureAllItems"
                                ItemTemplate="{StaticResource dataTemplateSelector}"
                                ItemsLayout="VerticalList"
                                ItemsSource="{Binding FilteredTransactions}"
                                ItemsUpdatingScrollMode="KeepScrollOffset"
                                Margin="{StaticResource pageMargins}"
                                RemainingItemsThreshold="5"
                                RemainingItemsThresholdReachedCommand="{Binding LoadMoreCommand}">

Basic Information

  • Version with issue: 4.4.0.991477, 4.6.0.726
  • Last known good version: N/A
  • IDE: Visual Studio for Mac
  • Platform Target Frameworks:

    • iOS: 11.4, 13.4, 13.4.1

    • Android:

    • UWP:

  • Android Support Library Version:
  • NuGet Packages:
  • Affected Devices: All iOS devices.

Screenshots

Reproduction Link

Workaround

collectionview iOS 馃崕 bug

Most helpful comment

This issue is already reported #8383

All 4 comments

Works fine on Android but can reproduce the issue on iOS:
Issue10643.zip

Facing same issue, even the same issue exist in the Scrolled Event:
_Scrolled(object sender, ItemsViewScrolledEventArgs e)

If items are grouped then e.LastVisibleItemIndex start-overs from Zero for every group scrolled to bottom.

_This is blocker for infinite scrolling in iOS._

@msftgits @msftdata

This issue is already reported #8383

I have the same problem. When we can have a solution?

Was this page helpful?
0 / 5 - 0 ratings