UITableViewHeaderFooterView subclass with auto layout and section reloading won't work well together

后端 未结 11 1425
天涯浪人
天涯浪人 2020-12-30 23:04

I am trying to incorporate auto layout into my UITableViewHeaderFooterView subclass. The class is pretty basic, just two labels. This is the complete subclass:



        
11条回答
  •  清歌不尽
    2020-12-30 23:59

    I don't see where you call translatesAutoresizingMaskIntoConstraints = NO on the footer itself. Should you do this when you create it?

    - (id)initWithReuseIdentifier:(NSString *)reuseIdentifier {
        self = [super initWithReuseIdentifier:reuseIdentifier];
        self.translatesAutoresizingMaskIntoConstraints = NO;
        MBTableDetailStyleFooterViewCommonSetup(self);
        return self;
    }
    

提交回复
热议问题