可能重复:
UITableView set to static cells. Is it possible to hide some of the cells programmatically?
使用故事板,可以通过将内容模式更改为“静态单元格”而不是“动态原型”,在Interface Builder中完全布局UITableView
。这在创建某些类型的UI时非常有用,但它似乎有其局限性。
我想使用静态单元布局布局,但我希望表视图的一部分基于另一个表视图单元格中的开关来显示/隐藏自身。这可能是使用静态单元格,还是我必须采用传统的方法?
答案 0 :(得分:1)
您可以尝试使用以下解决方案隐藏单元格:UITableView set to static cells. Is it possible to hide some of the cells programmatically?
然后使用开/关BOOL显示/隐藏它们。