Description
openedon Jun 18, 2024
Description
I have a grouped CollectionView with simple labels as items. Some of these items can be multiple lines long via WordWrap. When I add items to a group, everything works perfectly on Android, but on iOS, the CollectionView only gives one row per item regardless of size, leading to overlapping or partially hidden items. The view only corrects itself when another group is added/removed OR when something triggers a UI refresh such as rotating the screen or scrolling the affected area out of and back into view. I have not found any way to manually trigger a UI recalculation after adding/removing items that properly recalculates. The Collection/Property Changed notifications make the items appear/disappear, but do not properly calculate the size of each item in the CollectionView.
Video screen capture of the issue:
MAUI.CollectionView.Bug.ScreenCap.mp4
Steps to Reproduce
- Launch the app on an iOS Simulator or Device
- Click Category 1 (note the overlapping items due to only having one row per item including two-line items)
- Click Category 2 (Category 1 refreshes and corrects itself - how can I force this back in step 2?)
- Click Category 3 (note the final two-line item is cut off as one one row of height was allocated)
- Click Category 2 again (Category 3 corrects itself)
Link to public reproduction project repository
https://github.com/mattkeene/CollectionViewRowHeightBugIOS
Version with bug
8.0.60 SR6
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17
Did you find any workaround?
The only workaround I have found is to completely clear and reassign the CollectionView.ItemsSource before adding/removing items then reassigning it afterwards, which in effect kills the UI animations and makes the UI jumpy. Also, because it's a brand new list, it jumps to the top of the CollectionView, losing their place.
Relevant log output
No response