UITableViewCell中的多余填充,带有多行文本

时间:2015-04-07 20:18:50

标签: uitableview swift autolayout height cell

为什么会这样?我顺便说一句,我没有使用IB。

CODE:

cell = self.tableView.dequeueReusableCellWithIdentifier("NormalCell") as UITableViewCell
cell.textLabel?.lineBreakMode = NSLineBreakMode.ByWordWrapping
cell.textLabel?.numberOfLines = 0
cell.textLabel?.text = items[indexPath.row]["text"] as? String

图片:

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

您需要正确设置约束。看看下面的截图!

1)设置约束

http://prntscr.com/6r5i2z

2)检查表属性

http://prntscr.com/6r5i8y

3)运行项目!就是这样!

如果您有任何其他问题,请与我们联系!

相关问题