0
我正在尝试制作基于背景颜色更改单元格高度的应用程序。我想拥有它,这样如果它们的背景颜色是青色或橙色,单元格会更小,但我似乎无法找到正确的方法来完成它。我有代码来改变高度,但我不知道使用正确的参数。基于背景颜色不能更改单元格高度
override func tableView(tableView: UITableView,
heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if indexPath.row == 1 {//should be if cell.backgroundcolor or something
return 100 //noncolored cells
} else {
return 20 // colored cells
}
}
你有能力解决这个问题吗? – Miknash