Re: UITableView's tableFooterView and autolayout
Re: UITableView's tableFooterView and autolayout
- Subject: Re: UITableView's tableFooterView and autolayout
- From: Torsten Curdt <email@hidden>
- Date: Wed, 11 Jun 2014 20:46:03 +0200
Meh. Then I hope for a huge number of radars because this makes it
feel a little half baked - to put it nicely.
Feels like a strange oversight given how Apple is pushing autolayout.
Thanks for the responses guys.
cheers,
Torsten
On Wed, Jun 11, 2014 at 8:23 PM, Luke Hiesterman <email@hidden> wrote:
> You have to set the frame yourself (before assigning to the tableView.tableFooterView) property. You can use autolayout and systemSizeFittingSize to get the appropriate size, but you have to apply it yourself.
>
> Luke
>
> On Jun 11, 2014, at 11:16 AM, Torsten Curdt <email@hidden> wrote:
>
>> My question really isn't about positioning.
>>
>> Given that the tableview scrolls vertically the width should give the
>> horizontal width constraint for the footer view. The height of the
>> footer should come from the intrinsic size of the footer view. At
>> least that's how I image it should work.
>>
>> Now the question is if that's possible or not. And if not - how people
>> are dealing with this.
>>
>> Thanks for your solution, Sebastian!
>>
>> ...but the question is whether this is possible without manually
>> adjusting the frame.
>>
>> cheers,
>> Torsten
>>
>>
>>
>> On Wed, Jun 11, 2014 at 6:21 PM, Sebastian Celis
>> <email@hidden> wrote:
>>> On Jun 11, 2014, at 9:41 AM, Torsten Curdt <email@hidden> wrote:
>>>
>>>> Thanks but there you are setting the frame yourself. The idea was to
>>>> use constraints. Usually you would pin them to the superview. But in
>>>> this case...
>>>
>>> My solution uses Auto Layout constraints to get the appropriate size for the header view using systemLayoutSizeFittingSize. Given how UITableViews work when coupled with Auto Layout I believe you do have to set the frame yourself but you can determine what the frame should be using Auto Layout constraints.
>>>
>>> You can not use Auto Layout to *position* the header or footer view, but you can use Auto Layout to layout any views within that header or footer. If I understand your original situation, you probably want to use a UIView container for your label and then position that label within its container using Auto Layout.
>>>
>>> - Sebastian
>>>
>>
>> _______________________________________________
>>
>> 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
>
_______________________________________________
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