Skip to content

iOS CollectionView doesn't respect a change to ItemsLayout when using Items2.CollectionViewHandler2 #31259

@gbarkerz

Description

@gbarkerz

Description

When using the regular CollectionView on iOS, my app could change its ItemsLayout at runtime and so re-layout all the UI in response to a change in screen orientation. Due to the CollectionView layout apparently not working as expected on iPhone 16, I moved to use Items2.CollectionViewHandler2. By doing that, the layout problems went away on iPhone 16. However, I then found an attempt to change its ItemsLayout at runtime no longer works. This means when the user rotates their devices, my app now has to tell the user to restart the app.

Steps to Reproduce

  1. Run the sample at https://github.com/gbarkerz/ItemsLayoutChangeSample.
  2. Find a click on the button does nothing.
  3. Comment out the code setting up use of Items2.CollectionViewHandler2.
  4. Re-run the app and find a click of the button changes the layout fine.

Link to public reproduction project repository

https://github.com/gbarkerz/ItemsLayoutChangeSample

Version with bug

9.0.100 SR10

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 18.5.9214/9.0.100 SDK 9.0.300, VS 17.14.36408.4

Did you find any workaround?

I have no workaround, as I can't revert to not using Items2.CollectionViewHandler2, as the regular CollectionView presents broken layout with the iPhone 16 simulator.

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewcollectionview-cv2i/regressionThis issue described a confirmed regression on a currently supported versionp/0Current heighest priority issues that we are targeting for a release.platform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions