//详情
self.detailLabel = [UILabel new];
self.detailLabel.font = [UIFont systemFontOfSize:15];
self.detailLabel.numberOfLines = 0;
self.detailLabel.preferredMaxLayoutWidth = WIDTH(self);//要是设置多行Label的话,必须设置此属性
self.detailLabel.backgroundColor = [UIColor whiteColor];
[self addSubview:self.detailLabel];
[self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.footTitleBackView.mas_bottom).offset(5);
make.left.and.right.mas_equalTo(0);
make.bottom.mas_equalTo(self.mas_bottom);
}];
[self.detailLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical];
masonry 设置多行Label
最新推荐文章于 2020-06-01 20:25:23 发布