【发布时间】:2015-08-28 13:08:55
【问题描述】:
我有 tableView,当我输入时我想要自动高度单元格。但我不知道如何解决它。我的第一个想法是:
self.chatTableView.cellForRowAtIndexPath(indexPath)?.textLabel?.text = new_char
self.chatTableView.cellForRowAtIndexPath(indexPath)?.sizeToFit()
self.chatTableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: false)
当我在.sizeToFit() 中有这行时,我的结果如下所示:
但是当我评论这一行时:
self.chatTableView.cellForRowAtIndexPath(indexPath)?.textLabel?.text = new_char
self.chatTableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: false)
有什么办法可以解决吗?
【问题讨论】:
标签: swift uitableview swift2