Re: Dynamic-width Collection View
Re: Dynamic-width Collection View
- Subject: Re: Dynamic-width Collection View
- From: Doug Hill <email@hidden>
- Date: Wed, 10 Aug 2016 14:27:45 -0700
Jonathon,
Thanks for the feedback.
A question that comes to mind is, what about making cells the same size as the collection view requires going through subclassing the collection view layout? Apple documentation IMPLIES this should work. It even documents that developers should use preferredLayoutAttributesFittingAttributes for this very purpose.
The reason I don't want to subclass flow layout is that I pretty much want the exact functionality the default flow layout provides:
1. Automatically calculating layout rects that flow across lines.
2. Calculating the height of cells dynamically at runtime via 'estimatedItemSize'
Given that, I'm open to ideas on what I should override in a layout subclass. Particularly ones that don't require me to reimplement #1 and #2 above.
Doug Hill
> On Aug 10, 2016, at 2:16 PM, Jonathan Hull <email@hidden> wrote:
>
> Because you are trying to make the width of the cell the same size as the collection view, I would strongly consider writing a small subclass of flow layout. It honestly sounds like less work than what you are dealing with now.
>
> Thanks,
> Jon
>
>> On Aug 10, 2016, at 1:29 PM, Doug Hill <email@hidden <mailto:email@hidden>> wrote:
>>
>>>
>>> On Aug 10, 2016, at 11:10 AM, Doug Hill <email@hidden <mailto:email@hidden>> wrote:
>>>
>>> I'm currently trying to implement something that seems basic but has been driving me nuts: making a Collection View with cells that are dynamic-width and height at runtime.
>>>
>>
>> Again, looking for any ideas, pointers, etc. about any of this, including whether I'm going about this the wrong way.
>>
>> Doug Hill
_______________________________________________
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