-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] CollectionView items are not being displayed with a corresponding error messsage in the output (XF 5.0) #13323
Comments
@hartez Do you have any workarounds? Maybe like setting height request somewhere or i dont know. Or should i stay on the prerelease version? |
@hartez i have an update for you, maybe it will help. When setting the ItemSizingStrategy to MeasureFirstItem the problem dissapears. But unfortunately in most work cases the cells must be different sizes, so it is not a workaround |
I have the same problem that happened after the same update. |
@ZacharyInDallas as a workaround for now you can try changing the await Task.Delay(50) before showing ur items. It solved the issue in my situation |
That makes sense - the errors you're seeing are coming from AutoLayout, and MeasureFirstItem disables AutoLayout. Another workaround that's not great but will prevent the errors is to populate the data after the animation has completed. The reason this worked before the last version of 5.0 was that the actual item animations and layout used to happen in a PerformBatchUpdates call which we removed because it was causing all kinds of other problems. (That's also why the Task.Delay workaround is helping - this is partly a timing bug.) All of the autolayout errors seem to point to the height of the content being 1 greater than the UICollectionView's frame, which is making me wonder if this is some sort of measurement or rounding issue between CollectionView and ContentView. |
Well, i am comfortable with Task.Delay) so, if this is not an issue, it may be closed, i guess. Thank u for ur time and explanation! |
MeasureFirstItem may work for me, but CarouselView was also broken in this release so I have addition problems. Some of my CollectionViews are in CarouselViews. |
Try the Task.Delay workaround |
@themronion No, we'll definitely keep this open so we can fix it. |
Ok! Thanks! |
Where it is placed to solved the problem in some event? |
Has there been any update on this bug? It's still showing in the latest release version for the CarouselView |
Issue is still here. |
Same thing with my iOS part of the project. I an reproduce it with the latest version installed on my laptop Visual Studio Enterprise 2019 for Mac Xamarin.iOS |
you are totally 1000% correct. The issue is due to a timing issue. Y fixed this by adding a quick activity indicator to display a loading event animation, which shows and hide while returning the data, so that fixed the issue. thanks for sharing this information. It was very helpful. |
Setting ItemSizingStrategy to MeasureFirstItem and adding delay before setting item source resolved issue, many thanks to the community for these workaround 👍 👍 👍 👍 👍 |
Still running into this issue with xamarin forms 5.0 sr13 (latest). using MeasureFirstItem isn't an option for us, so we will try the task delay, but it'd be nice to have a proper fix. |
This issue still occurs with CarouselView in 5.0.0.2545. |
I take it that has been fixed in MAUI? What about in Xamarin Forms? MeasureFirstItem did not work for me, but Task.Delay has. Is there a better workaround to this? How would one go about populating the data after the animation - a custom renderer event maybe? |
Description
This happens only on xf 5.0 - the latest stable release (ios platform). Downgrading to prerelease 6 fixes the issue, so my guess something happened in between there. Attaching a reproduction link. Just press the button and observe a message in the output window stating something like this:
Note that hiding and clicking the button again will show my items - in the reproduction case. In my real world project the items are still not being drawn no matter how many times i click the button to show the sheet and hide it again.
Steps to Reproduce
Expected Behavior
Collectionview items are being shown
Actual Behavior
Collectionview items aren't being shown on first click, on second - are being shown
Basic Information
Environment
Visual Studio latest
Reproduction Link
Adding as a zip file
App1.zip
Workaround
Downgrade to prerelease, or set ItemSizingStrategy to MeasureFirstItem
The text was updated successfully, but these errors were encountered: