Masnory相对定位的时候
_infoLabel= [UILabelnew];
[self.contentViewaddSubview:_infoLabel];
_infoLabel.font= [UIFontboldSystemFontOfSize:15];
[_infoLabelmas_makeConstraints:^(MASConstraintMaker*make) {
make.left.mas_equalTo(50);
make.right.mas_equalTo(-10);
make.top.mas_equalTo(10);
make.bottom.mas_equalTo(-10);//上下左右全部设置高度宽度不设置
}];
_infoLabel.numberOfLines=0;//不限制行数
然后在- (CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath {
CGFloat cellHeight = [tableView fd_heightForCellWithIdentifier:@"RepairInfoCell"cacheByIndexPath:indexPathconfiguration:^(RepairInfoCell*cell) {
[selfconfigureCell:cellatIndexPath:indexPath];
}];
return cellHeight;
- (void)configureCell:(RepairInfoCell*)cell atIndexPath:(NSIndexPath*)indexPath 这个方法其实就是cell上控件的赋值方法
和- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath公用