Reputation: 3045
I'm trying to create a header view for my section header for my UITableView by using the 3rd option here
http://hons82.blogspot.it/2014/05/uitableviewheader-done-right.html
I've got it working but my view doesn't fit properly, how can I make it fit? and be dynamic? Do I have to use constraints? but how do I do that if the view is in a separate nib and not in the main storyboard?
Here's a screen shot of the nig
and the problem
Upvotes: 0
Views: 147
Reputation: 104092
You should have constraints, internal to your view -- that is constraints that fix the position of the search bar and buttons inside your view (which should be a UITableViewHeaderFooterView or a subclass). The view itself will automatically be the width of the table view, and the height should be set by you in tableView:heightForHeaderInSection.
Upvotes: 1