Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CollectionView requires slight scroll before item spacing becomes correct #12554

Closed
Tommigun1980 opened this issue Oct 21, 2020 · 3 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Oct 21, 2020

I tried converting my bindable stack layouts to collection views but am running into several problems again preventing me from using them.

I have items in the collection view that are of different sizes, so ItemSizingStrategy is MeasureAllItems. I have a LinearItemsLayout with ItemSpacing of 12. When the view loads all the items seem to have double item spacing. As soon as I scroll the view even slightly all items jump to their correct positions.

I have a video of the issue, please let me know where to send it if it would be useful.
The issue only started to happen once I replaced a bindable layout with a collection view.

XF 5 latest preview, iOS (didn't test on Android).

@Tommigun1980
Copy link
Author

Tommigun1980 commented Oct 25, 2020

I think this issue is related to #12555 which may be both caused by #11511 and #10842.

Furthermore, I can not reproduce this with:

  1. A collection view if the item sizing strategy is set to measure first item (unfortunately I can't do it here as the items have different sizes)
  2. A list view
  3. A bindable layout

So I think all of these issues have to do with bugging MeasureAllItems in CollectionView only, possibly when using data templates of different heights (or merely if the items themselves have different heights, haven't tested).

If this could be fixed CollectionView would become the de-facto collection component, but unfortunately I can't use it at all with these issues. Please please prioritise this as it completely defeats the purpose of the collection view and the other means have been deprecated.

@Tommigun1980
Copy link
Author

I found a fix for this -- one of my data templates had height set to * instead of Auto, and changing it to Auto fixed this. What is strange, however, is that with * CollectionView requires the slight scroll for the items to align properly -- this does not happen with for example bindable layouts so I do think this is an issue in CollectionView still, but I am just happy it works now.

Thanks.

@rmarinho
Copy link
Member

rmarinho commented Nov 5, 2020

Duplicated #12722

@rmarinho rmarinho closed this as completed Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants