我想将多个静态表格视图单元格的高度更改为零并恢复正常。
override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if reminderHidden && indexPath.section == 1 && indexPath.row == 1 {
return 0
}
else {
return super.tableView(tableView, heightForRowAtIndexPath: indexPath)
}
}
我可以更新 bool 值 & 上述方法适用于隐藏一个静态单元格。但它在返回一个值后停止。我想隐藏两个静态单元格并在我更改一个布尔值时将它们恢复正常。