You need to use the UIView systemLayoutSizeFittingSize:
method to obtain the minimum bounding size of your header view.
I provide further discussion on using this API in this Q/A:
How to resize superview to fit all subviews with autolayout?
More Related Contents:
- Auto layout constraints issue on iOS7 in UITableViewCell
- Using Auto Layout in UITableView for dynamic cell layouts & variable row heights
- Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7
- What is NSLayoutConstraint “UIView-Encapsulated-Layout-Height” and how should I go about forcing it to recalculate cleanly?
- reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling
- How do I programmatically set device orientation in iOS 7?
- How to resize superview to fit all subviews with autolayout?
- iOS 7 TableView like in Settings App on iPad
- Is it possible to obtain a dynamic table view section header height using Auto Layout?
- What is the meaning of the “no index path for table cell being reused” message in iOS 6/7?
- Multiple UILabels inside a self sizing UITableViewCell
- Remove empty space before cells in UITableView
- UITableView within UIScrollView using autolayout
- indexPathForCell returns nil since ios7
- UITableView dynamic cell heights only correct after some scrolling
- Auto-layout: What creates constraints named UIView-Encapsulated-Layout-Width & Height?
- UITableViewCell with autolayout left margin different on iPhone and iPad
- Button in UITableViewCell not responding under ios 7
- UITextViews in a UITableView link detection bug in iOS 7
- table header view height is wrong when using auto layout, IB, and font sizes
- Trouble with AutoLayout on UITableViewCell
- Using autolayout in a tableHeaderView
- When should translatesAutoresizingMaskIntoConstraints be set to true?
- UITableView auto resizing row constraint breaking mysteriously on iPhone 6Plus
- Long press on UITableView
- Silent Push Notification in iOS 7 does not work
- Failed to obtain a cell from its DataSource
- Auto Layout in UICollectionViewCell not working
- Detect when UITableViewCell goes off the screen
- Can I use autolayout to provide different constraints for landscape and portrait orientations?