【发布时间】:2015-04-15 08:11:43
【问题描述】:
在 tableView 中我有一个 web 视图,高度单元格应该等于 webView,我尝试通过以下代码编辑单元格的行高:
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
let cell = tableView.cellForRowAtIndexPath(indexPath) as ActivitiesCell
return cell.webView.scrollView.contentSize.height
}
但我在初始化 var 单元格时遇到了这个异常:“线程 1:EXC_BAD_ACCESS(code=2,address=0x306d2c): 那么如何根据 webview 高度使单元格的高度动态化? 谢谢。
【问题讨论】:
标签: ios uitableview swift