UICollectionView self-sizing cells not rendering properly after using UICollectionFlowLayout's invalidateLayout and estimatedItemSize methods

Originator:chroman16
Number:rdar://23728918 Date Originated:02-Dec-2015 02:03 PM
Status:Open Resolved:
Product:iOS Product Version:iOS 9.0
Classification: Reproducible:Always
 
Summary:
UICollectionView self-sizing cells not rendering properly after using UICollectionFlowLayout's invalidateLayout and estimatedItemSize methods.

Also, if you try to override preferredLayoutAttributesFittingAttributes to manually the right frame.x position is completely ignored. 

No combination of constraints that I could find would solve the problem.

Steps to Reproduce:
1. Run the app in iPad Portrait Mode.
2. Scroll the UICollectionView down to set the first cells not visible.
3. With a swipe from the right edge of the screen, invoke Split Screen to pick a secondary app (i.e. Calendar). App should be in split-screen multitasking.
4. App now show a single row of cells.
5. Scroll to top.

Animation: https://www.dropbox.com/s/4z0d0wcb8piuqtu/Animation.gif?dl=0

Expected Results:
First UICollectionViewCell is rendered in the same position as the other cells.

Actual Results:
First UICollectionViewCell is not rendered in the right position.

Version:
iOS 9.0

Notes:


Configuration:
iPad Air 2

Attachments:
'UICollectionViewResizingCells.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!