Xamarin.forms: [Bug] [iOS] CollectionView - blank spaces beetween items on updating list when items has different heights

Created on 22 Jul 2020  路  7Comments  路  Source: xamarin/Xamarin.Forms

There some blank spaces appears between items on CollectionView on iOS if items has different heights. Best way to show these spaces is updating the list, for example inserting new item at the top. This problem occurs only on iOS, works fine on Android.

Steps to Reproduce

  1. Use my reproduction repo at the bottom of this post
  2. Run application on iOS device/simulator
  3. Click on "Get better stuff" button

Expected Behavior

These blank spaces should not appears after inserting new item to list, like on image below:
Simulator Screen Shot - iPhone 11 - 2020-07-22 at 16 47 44

Actual Behavior

Blank spaces appears after inserting new item to list. Look how it looks on image below:

Simulator Screen Shot - iPhone 11 - 2020-07-22 at 16 47 41

Additional comments

Besides, CollectionView doesn't scroll smoothly, when you try to implement pagination on your list and if items on this list have different heights you can observe that list is jumping a bit, it should stay on same scrolling position. Look at video below:
https://streamable.com/b4tsmv

Basic Information

  • Xamarin Forms: 4.7.0.11.42
  • Visual Studio for Mac 8.6.5 (build 23)
  • Xcode ver 11.5

Reproduction Link

https://github.com/mariaszek9003/XamarinFormsCollectionViewTest

collectionview 5 high impact iOS 馃崕 bug

Most helpful comment

Maybe this is the root cause of https://github.com/xamarin/Xamarin.Forms/issues/12554 and https://github.com/xamarin/Xamarin.Forms/issues/12555?

If so Xamarin please fix this as it introduces so many follow-up bugs that it's almost impossible to use the CollectionView. It would be such a useful component.

Thanks.

All 7 comments

I experience that, too. It's quite annoying bug

In the example you haven't got ItemSizingStrategy="MeasureAllItems" set, the default behaviour is to measure the first item and use that size for all items.

@DuncWatts MeasureAllItems is a default value for ItemSizingStrategy, so it not make any difference if I set it explicitly https://docs.microsoft.com/pl-pl/dotnet/api/xamarin.forms.itemsizingstrategy?view=xamarin-forms

Maybe this is the root cause of https://github.com/xamarin/Xamarin.Forms/issues/12554 and https://github.com/xamarin/Xamarin.Forms/issues/12555?

If so Xamarin please fix this as it introduces so many follow-up bugs that it's almost impossible to use the CollectionView. It would be such a useful component.

Thanks.

Thats a big one

A huge one

That's what she said.

Was this page helpful?
0 / 5 - 0 ratings