I am trying to incorporate auto layout into my UITableViewHeaderFooterView subclass. The class is pretty basic, just two labels. This is the complete subclass:
I had a similar problem with just one extra label in the contentView. Try to insert
static void MBTableDetailStyleFooterViewCommonSetup(MBTableDetailStyleFooterView *_self) {
_self.contentView.translatesAutoresizingMaskIntoConstraints = NO
[...]
}
at first line in your MBTableDetailStyleFooterViewCommonSetup function. For me, this works in conjunction with reloadSections:withRowAnimations:.
Update:
I also added a new constraint for the contentView to use all width:
NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[contentView]|"
options:0
metrics:nil
views:@{@"contentView" : _self.contentView}];
[_self.contentView.superview addConstraints:horizontalConstraints];