Re: Can't get dynamically sized Collection View cells
Re: Can't get dynamically sized Collection View cells
- Subject: Re: Can't get dynamically sized Collection View cells
- From: Peter Tomaselli <email@hidden>
- Date: Fri, 02 Oct 2015 08:30:56 -0400
[re-sending because my last message had size problems]
Nifty way of demoing there, Roland, I’ll have to try that!
I’d still be curious to know if anyone is using this feature “in production”. Because those crashes, problems rotating (at least for me), and also this, which I definitely ran into circa iOS 8:
http://stackoverflow.com/questions/25573855/vertically-scrolling-uicollectionview-with-self-sizing-cells-only-displays-half
> On Sep 30, 2015, at 9:34 PM, Roland King <email@hidden> wrote:
>
> [snip]
>
> Result, 150x150 boxes on the screen neatly laid out.
>
> Hooked up a button to iterate the cells on screen, find the embedded randomView and call its randomize function to reset the intrinsic content size, after they were all done, called collectionView.collectionViewLayout.invalidateLayout()
>
> Result, boxes all showed up in their new randomized sizes and the layout adjusted everything to fit, changed the number of boxes per line and the size of the lines. So just having cells with a fully-specified intrinsicContentSize and setting estimatedSize on the collection view flowlayout is enough to get dynamic cells without having to measure them or do any other work. So I deduce from that that Apple doesn’t lie and it does actually work as the WWDC session says.
>
> I did get some quite cool crashes when I set the estimated size far from the actual size, were I actually trying to do this for real I’d probably look into it but .. since I’m not.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden