UICollectionViewCompositionalLayout incorrect item size on iOS 14

Hello,

I'm currently facing an issue with compositional layout. (FB8812336)

The item height is set to .estimated(100) and the width is set to .fractionalWidth(1.0). On the initial display the cell is not wrapping the label content. The layout of the cells are corrected after scrolling.

The issue doesn't occurred on iOS 13 (screenshot) and can also be seen in the Apple's sample code


Do I miss a flag or a property introduced in iOS 14? Does someone know how to fix this issue?

Thank you.
This is a regression bug. I had filed openradar.appspot.com/FB8724843 back in September.

In testing this again today with Xcode 12.1.1 Release Candidate, it seems the user needs to be on iOS 14.2 for it to not occur. Just building the app against the 14.2 SDK doesn't seem to fix the bug if run on a 14.1 device.

Video showing bug at twitter.com/jamiemcd/status/1308132262635016199
Hello,

is this issue already solved? I'm facing a similar issue with UICollectionViewCompositionalLayout. When I use an orthogonal scrolling section with items that have a fixed width and an estimated height, they are shown correctly but I can select the items only within the estimated height. Any click outside of the estimated item size is ignored. Also horizontal scrolling does not work. Vertical scrolling seems to trigger some recalculation and then the items are selectable and horizontally scrollable as expected.

I'm working in iOS 14.3 SDK and Xcode 12.3

Code Block language
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(1.0))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
let groupSize = NSCollectionLayoutSize(widthDimension: .absolute(200.0), heightDimension: .estimated(1.0))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
layoutSection = NSCollectionLayoutSection(group: group)
layoutSection.interGroupSpacing = 15.0
layoutSection.orthogonalScrollingBehavior = .continuousGroupLeadingBoundary


UICollectionViewCompositionalLayout incorrect item size on iOS 14
 
 
Q