Cell xib label自适应高度

AutoLayoutLabel:

- (void)setBounds:(CGRect)bounds {

[super setBounds:bounds];

if (bounds.size.width != self.preferredMaxLayoutWidth) {

self.preferredMaxLayoutWidth = self.bounds.size.width;

[self setNeedsUpdateConstraints];

}

}

cellHeightForRow:

CGSize size = [cc.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];

return size.height + 1.0f;

你可能感兴趣的:(Cell xib label自适应高度)