Re: How to get variably sized header in a UICollectionView supporting both orientations
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 Duncan <email@hidden>
- Date: Fri, 04 Oct 2013 11:57:36 -0700
On Oct 4, 2013, at 11:35 AM, David Hoerl <email@hidden> wrote:
> Becoming increasingly adept at autolayout but currently stumped. What I am trying to do is design a UICollectionView header that using constraints is suitable for portrait and landscape.
>
> I have a bunch of views in it, each grouped into a container view. What I'd like to do is when the view rotates, move the container views around. Currently this seems impossible because the size of the header (and footer) must be specified to the Flow Layout before the view is even created, and it appears to be fixed from them on.
Do you mean the header/footerReferenceSize properties? If so I would think this would just work, since the flow layout will automatically size the width or height (depending on the scrolling direction) to fill the width or height of the collection view, allowing your container to just specify its sizes relative to the parent view size without needing to know the orientation.
But maybe I just don’t understand exactly what you are running up against?
>
> As it stands now, what I'm doing is creating the header in code, and using knowledge of what orientation the view will be shown in, and varying the constraints on the container views. By reloading the collection view on every rotation, I can get a new (and properly) sized header.
>
> This seems like driving a nail with a sledgehammer, but nothing else comes to mind. Very open to suggestions on better methods.
>
> 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
--
David Duncan
_______________________________________________
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