您好我正在尝试根据textlabel和detailtextlabel动态更改我的行高度。基于文本标签和细节文本标签的行高 - 物镜c
以下是我的代码:
NSString *title = [NSString stringWithFormat:@"%@%@%@",_note.committeeStaffName,@" - ",_note.dateCreated];
cell.textLabel.text = title;
cell.detailTextLabel.text = _note.note;
我试图调整基础上,为textLabel和detailTextLabel表的行的高度。 textLabel不会超过一行。 detailTextLabel包含不同长度的大文本。我已经阅读了委托方法heightForRowAtIndexPath的几个例子,但是他们都没有清楚地说明在方法heightForRowAtIndexPath中应该做什么以及在cellForRowAtIndexPath中应该执行什么代码。任何人都可以清楚地解释一下代码应该在两个方法heightForRowAtIndexPath和cellForRowAtIndexPath中进行调整,以便根据包含textLabel和detailTextLabel的内容调整表格行的高度。
[根据文本量更改UITableViewCell高度]的可能重复(http://stackoverflow.com/questions/9827126/change-the-uitableviewcell-height-according-to-amount-of-text) – CodaFi 2013-03-07 00:34:47