• 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: UITableView's tableFooterView and autolayout
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UITableView's tableFooterView and autolayout


  • Subject: Re: UITableView's tableFooterView and autolayout
  • From: Torsten Curdt <email@hidden>
  • Date: Wed, 11 Jun 2014 16:41:34 +0200

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...

I tried assigning the footer view and then assigning the constraints
to the super view. It just did not yield the expected results.

cheers,
Torsten

On Wed, Jun 11, 2014 at 3:56 PM, Sebastian Celis
<email@hidden> wrote:
> Hi Torsten,
>
> On Jun 11, 2014, at 6:26 AM, Torsten Curdt <email@hidden> wrote:
>
> So what's the story with tableFooterView and tableHeaderView and
> autolayout? I am trying to put a label into a footer.
>
>
> I have had luck with code like the following:
>
> - (void)viewDidLoad
> {
>     [super viewDidLoad];
>
>     self.headerView = [[MyView alloc] initWithFrame:CGRectZero];
> }
>
> - (void)viewDidLayoutSubviews
> {
>     [super viewDidLayoutSubviews];
>
>     CGRect frame = CGRectZero;
>     frame.size.width = self.tableView.bounds.size.width;
>     frame.size.height = [self.headerView
> systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height;
>     if (self.tableView.tableHeaderView != self.headerView ||
> !CGRectEqualToRect(frame, self.headerView.frame))
>     {
>         self.headerView.frame = frame;
>         [self.headerView layoutIfNeeded];
>         self.tableView.tableHeaderView = self.headerView;
>     }
> }
>
> - 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


  • Follow-Ups:
    • Re: UITableView's tableFooterView and autolayout
      • From: Sebastian Celis <email@hidden>
References: 
 >UITableView's tableFooterView and autolayout (From: Torsten Curdt <email@hidden>)
 >Re: UITableView's tableFooterView and autolayout (From: Sebastian Celis <email@hidden>)

  • Prev by Date: Swift video/PDF files within the WWDC 2014 video list
  • Next by Date: Re: UITableView's tableFooterView and autolayout
  • Previous by thread: Re: UITableView's tableFooterView and autolayout
  • Next by thread: Re: UITableView's tableFooterView and autolayout
  • Index(es):
    • Date
    • Thread