【发布时间】:2016-08-19 17:26:15
【问题描述】:
如何让它根据 textLabel 的长度自动调整每个单元格的高度?理想情况下,我希望 textLabel 也被包装,因此 textLabel 可以采用它需要的任意多行。以下代码是我目前拥有的:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let notification = self.fetchedTweetsArray[indexPath.row]
let cell = UITableViewCell()
cell.textLabel?.text = notification
return cell
}
【问题讨论】:
-
你在使用自动布局吗?
-
不使用自动布局
标签: ios iphone swift uitableview uilabel