-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] CollectionView is broken on IOS, when items have different sizes and ItemSizingStrategy="MeasureAllItems" #11011
Comments
Can you post the markup of your DataTemplate?
How are you handling the visibility of the rows? Are you setting IsVisible via DataBinding? Or some other way? |
@hartez, Visibility is handling by text existence - if there is no text in row there will be no label, so no height in "Auto" height row.
|
Also it is reproducible in a different types of Root elements for DataTemplate. |
I can confirm this issue. In my case, I have a DataTemplateSelector which selects two very different DataTemplates based on a property in my ItemViewModel. It often happens when the smaller Template is used in the lower third of the screen. |
Is there any workaround we could implement for the time being? |
I can confirm as well. Reason number 70 why CollectionView should still be experimental. |
Had the same problem. Because of the different Labels' heights their parent containers were overlapping. As a workaround I've set Labels' TextType proberty to HTML, and wrapped their values. Something like: |
I've the same problem. |
I had a similar problem with dynamically resizing items not being correctly resized and solved it by calling this every time after I change an item:
This seems to remeasure all items.. Don't forget to call it on a main thread. |
After a lot of attempt, I achieved to have a solution that is working on iOS with a CollecitonView Grouped containing different DataTemplate of different Sizes (using DataTemplateSelector) with hundred of items. If it can help :
Feel free to comment/enhance my solution :) |
This is fixed in 5.0.0.1931. |
This appears to be reoccurring in 5.0.0.2012 |
we still have the same issue |
Still same issue.. not to mention the jitterh scroll and initial janks |
@Redth I can confirm that MeasureAllItems in not working on iOS. I just tried it and I lose scrolling when I have it set. If I change it to MeasureFirstItem it works fine but not what I want |
@justinasfour04 I'm exactly facing the same issue. Sadly, it appears it won't be fixed until MAUI is released, maybe by the end of the year. |
Is not a workaround, but when i need to have different sized cells, i'm using ListView instead of collectionview |
Thanks @WanftMoon It appears that is what I need to implement then :( I was expecting to use the new SwipeViews on the colllection view. What a sad thing. |
@vhugogarcia what a shame. No one will be using MAUI right away when it comes out especially in a production environment. How is the Xamarin team not dedicating support right now to fixing these |
Don't waste your time with |
@bares43 Android is fine. iOS is the buggy one |
@justinasfour04 I know, but in Xamarin we usually do apps for both, Android and iOS :D |
I know that but I really don't want to build a collectionview from scratch |
@justinasfour04 It depends what you want but it's not that difficult. If you need just a feed of items, then just put a |
Maybe there is out there a nuget packages that provides a good collection view and listview alternative. I don't know. |
Syncfusion |
May be
|
Take a look at https://github.com/roubachof/Sharpnado.HorizontalListView it is called Horizontal list, but has vertical and grid too. |
Still not fixed in 5.0.0.2299... |
The same exact issue #10842 |
I have a very similar issue (in XF 5.0.0.2401, ios only) - it resizes everything to the height of the first item resulting in the stacks overlapping. But this only happens for me if the refreshview (containing the collectionview) has a refresh triggered. And for some reason it works when the screen is vertical or the app is running on ios version 12.4 (at least in the simulator). |
Description
CollectionView is broken on IOS when items have different sizes and ItemSizingStrategy="MeasureAllItems". It means that we have no way to use items with different sizes
Steps to Reproduce
Grid or FlexLayout (where Grid or Flex is child of DataTemplate) with 3 labels located in 3 rows (2 of them can be invisible in some cases which means that CollectionView cell height will be different from time to time). Of course we use ItemSizingStrategy="MeasureAllItems".
Expected Behavior
All items size set correctly like after scrolling (screenshot 2)
Actual Behavior
Some of items overlap each other
Basic Information
Probably related issues
#10625 #5455 #9000 #5455 #7788
Screenshots
posted in Steps to Reproduce
Reproduction Link
no
Workaround
no
The text was updated successfully, but these errors were encountered: