【发布时间】:2016-07-30 11:20:47
【问题描述】:
我有一个简单的表格视图,其中包含动态单元格。
每个单元格有 3 个元素(question as UILabel - Answer as UITextView - readmore as UIButton)
我只需要在每个单元格中显示来自答案的 2 行,当我单击阅读更多按钮时,单元格的高度应根据答案文本视图字符动态变化。
这是我的调用表单元格方法:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
tableCell = myTable.dequeueReusableCellWithIdentifier("fqaCell") as! fqaTableViewCell
myTable.estimatedRowHeight = 100
myTable.rowHeight = 100
return tableCell!
}
【问题讨论】:
标签: ios iphone swift tableview