• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get variably sized header in a UICollectionView supporting both orientations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get variably sized header in a UICollectionView supporting both orientations


  • Subject: Re: How to get variably sized header in a UICollectionView supporting both orientations
  • From: David Hoerl <email@hidden>
  • Date: Fri, 04 Oct 2013 17:45:41 -0400

On 10/4/13 5:09 PM, Steve Christensen wrote:
On Oct 4, 2013, at 1:52 PM, David Hoerl <email@hidden> wrote:

But its really odd - and I'm thinking about a bug report on this - that the delegate has to provide the size before the view is even created.

It make sense if you think about it: it's asking for sizes so that scroll view contentSize can be set and the layout can be determined. It would be a lot more expensive to have to actually build each of the cells for the entire collection just to get their sizes. This sort of behavior also happens with UITableView and its various cells.


In the old days, you had static views. Now with dynamic type, and the ability to more easily support different dynamic portrait/landscape layouts (with autolayout), the views can change a lot. Also, for table headers and footers, you created the view then set or returned it.

With Collections you have to "dequeue" it, and ostensibly you can only do this when asked for a cell (since there is no way I know to dequeue a view then tell the collection that you don't really need it after all).

Maybe I could dequeue one early on, cache it to get the sizes, and the first time only I'm asked for the view, return the cached one (then nil out the reference). This seems like it might work but IMHO would be "risky" in terms of stretching the API.

I will probably at least try that out when I get everything else working.

David

_______________________________________________

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


  • Follow-Ups:
    • Re: How to get variably sized header in a UICollectionView supporting both orientations
      • From: Steve Christensen <email@hidden>
References: 
 >How to get variably sized header in a UICollectionView supporting both orientations (From: David Hoerl <email@hidden>)
 >Re: How to get variably sized header in a UICollectionView supporting both orientations (From: David Duncan <email@hidden>)
 >Re: How to get variably sized header in a UICollectionView supporting both orientations (From: David Hoerl <email@hidden>)
 >Re: How to get variably sized header in a UICollectionView supporting both orientations (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: why isn't id<MyCellDelegate> an id?
  • Next by Date: Re: Doc Viewer in 5.0.1
  • Previous by thread: Re: How to get variably sized header in a UICollectionView supporting both orientations
  • Next by thread: Re: How to get variably sized header in a UICollectionView supporting both orientations
  • Index(es):
    • Date
    • Thread