CollectionView with GridItemsLayout: Issues when changing Span #8387
Labels
area-controls-collectionview
CollectionView, CarouselView, IndicatorView
area-layout
StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter
fixed-in-7.0.92
Look for this fix in 7.0.92!
fixed-in-7.0.100
fixed-in-7.0.101
fixed-in-8.0.0-preview.3.8149
Look for this fix in 8.0.0-preview.3.8149!
p/1
Work that is important, and has been scheduled for release in this or an upcoming sprint
partner/cat 😻
this is an issue that impacts one of our partners or a customer our advisory team is engaged with
platform/iOS 🍎
platform/windows 🪟
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
I have a CollectionView with a GridItemsLayout. Depending on the available size I want to show more (landscape view) or less (portrait view) items on a row.
In the SizeChanged event I compute and set the right Span.
Steps to Reproduce
See example project MauiGridItemsLayoutChangeSpanIssue
In the AppShell Flyout you can select two views:
Rotate the phone/tablet to see the number of items on a row change.
Version with bug
6.0.400 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Windows
Affected platform versions
iOS 15.5, Windows 10.0.19044
Did you find any workaround?
For iOS I found a workaround by adding a check for CollectionView==null in GridViewLayout.HandlePropertyChanged(). See
GridViewLayoutExt
in the example project. This works, because HandlePropertyChanged() for the Span property is called again when CollectionView is not null anymore, which is kinda weird.For Windows I did not look for a workaround yet.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: