【发布时间】:2015-04-01 09:59:34
【问题描述】:
我设计了如下的自定义单元格。
它将显示动态内容。我在为这些标签的顶部空间、底部空间、垂直拥抱优先级、垂直阻力优先级分配自动布局约束优先级并将行数设置为零和换行模式自动换行时遇到问题。 我试过了,但有些标签被剪掉了,如下图所示:
任何帮助设置标签的自动布局约束优先级将不胜感激..
label1的约束如附图所示
label2 的约束如附图中所示
string=@"我的名字是........我的名字是........我的名字是";
行高:
static AttendeesListViewCell *sizingCell = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sizingCell = [self.attendeess_TableView dequeueReusableCellWithIdentifier:cellIdentifierAttendessWithImage];
});
sizingCell.attendessNameLabel.text = string;
sizingCell.attendessTitleLabel.text = string;
sizingCell.attendessCompanyLabel.text = string;
sizingCell.label_city.text=string;
sizingCell.label_country.text=string;
[sizingCell setNeedsLayout]; [sizingCell layoutIfNeeded]; CGSize size = [sizingCell .contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
return size.height;
在行的单元格中:
参加者列表视图单元 *cell_attendee; cell_attendee = [tableView dequeueReusableCellWithIdentifier:cellIdentifierAttendessWithImage]; cell_attendee.attendessNameLabel.text = 字符串; cell_attendee.attendessTitleLabel.text = string;
cell_attendee.attendessCompanyLabel.text = string;
cell_attendee.label_city.text=string;
cell_attendee.label_country.text=string;
return cell_attendee;
谢谢。
【问题讨论】:
标签: ios ios-autolayout