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

[Bug] RefreshView jumps around when refreshing items when ItemSizingStrategy="MeasureAllItems" #12622

Open
Tommigun1980 opened this issue Oct 27, 2020 · 4 comments

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Oct 27, 2020

Hi.

I have a CollectionView inside a RefreshView, and when I pull it to refresh the items seem to get an invalid scroll position for a short while, when ItemSizingStrategy="MeasureAllItems". Please see the following video:

https://drive.google.com/file/d/1-ZV5QroF_JvRRw237mA5MeX90_68Hy3y/view?usp=sharing

NOTE: The glitch that is visible at 0:07 into the video happens on every pull, but because the video is apparently not 60fps the glitchy frames is visible only on the last pull in the video, but in real life the issue is very visible and happens on every pull. It looks like the scroll goes to 0 for a fraction of a second on every refresh, and could very well be the exact same bugs as #12555.

So I think this is at least related to (if not the same as) #12555 as the collection view's items also jump around when new items are added with ItemSizingStrategy="MeasureAllItems"?

Note: I would like to use ItemSizingStrategy="MeasureFirstItem", but the elements in there are images where their height is set to their width multiplied by a fixed aspect ratio (converter). This results in them getting an incorrect height with MeasureFirstItem, as apparently MeasureFirstItem is only ever calculated once and I couldn't find a way to refresh it anyhow. So in other words a height that is calculated from its own width forces one to use MeasureAllItems, which then exposes the issues associated with it.

Thanks.

XF 5-pre3, iOS (didn't test on other platforms).

@Tommigun1980
Copy link
Author

Workaround found for uniform dynamically assigned elements, as outlined in the report at #12697.

These are not duplicate reports however - this report details refresh view's behaviour with non-uniform contents.

@jsuarezruiz
Copy link
Contributor

@Tommigun1980 I do not have access to https://drive.google.com/file/d/1-ZV5QroF_JvRRw237mA5MeX90_68Hy3y/view?usp=sharing I want to see the glitch you described, could you change the access to that link?

@jsuarezruiz jsuarezruiz moved this from New to Needs Info in Triage Nov 16, 2020
@jsuarezruiz jsuarezruiz added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 16, 2020
@Tommigun1980
Copy link
Author

Tommigun1980 commented Nov 19, 2020

@Tommigun1980 I do not have access to https://drive.google.com/file/d/1-ZV5QroF_JvRRw237mA5MeX90_68Hy3y/view?usp=sharing I want to see the glitch you described, could you change the access to that link?

Hi @jsuarezruiz and thanks for notifying about the permissions problem. I fixed the link for you.

Please note that as mentioned the video doesn't seem to be grabbed at 60 fps so the issue is only visible in the pull at 0:08 into the video - in reality it happened on every pull but those frames were unfortunately not captured. In case the effect is not that obvious in the video - what happened is that on every pull the items in the collection view 'jumped' to the highest possible position for a fraction of a second, before jumping back to their correct position where you were 'pulling' the view. This created a very jarring visual artefact.

Thank you.

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Nov 30, 2020
@Redth Redth moved this from Needs Info to New in Triage Dec 1, 2020
@hartez hartez added this to Backlog in CollectionView via automation Jan 4, 2021
@hartez hartez removed this from New in Triage Jan 4, 2021
@Tommigun1980
Copy link
Author

Tommigun1980 commented Jun 9, 2021

I was able to find a workaround for this.

My hierarchy is as such:
StackLayout -> StackLayout -> Grid -> StackLayout -> RefreshView -> CollectionView

If the SECOND StackLayout is set to VerticalOptions="FillAndExpand", then it seems to consistently work also on a physical iOS device.

The issue was never reproducible on an Android or an iOS simulator and only happened randomly on a physical iOS device. If the page containing the RefreshView/CollectionView was opened several times in succession it was rendered correctly maybe 1/3 of the times. With the above workaround it seems to work 100% of the time.

So there is some bug in the layout engine, which is only reproducible on a physical iOS device, but not 100% of the time.

@hartez hartez removed their assignment Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
CollectionView
  
Review Backlog
Development

No branches or pull requests

5 participants