PHP中文网2017-04-18 09:23:28
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(@0);
make.bottom.equalTo(@0);
}];
迷茫2017-04-18 09:23:28
Dynamicly calculate the string height when obtaining data, and set the parent control frame
Related methods: CGRect strRect = [str boundingRectWithSize:CGSizeMake(maxWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : [UIFont systemFontOfSize: fontSize]} context:nil];
迷茫2017-04-18 09:23:28
It’s okay if the height of the parent view is not given. The content will prop it up
Of course, if it is a cell, you need to calculate it yourself