UITableView设置为静态单元格。是否有可能以编程方式隐藏一些单元格? [英] UITableView set to static cells. Is it possible to hide some of the cells programmatically?
本文介绍了UITableView设置为静态单元格。是否有可能以编程方式隐藏一些单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
UITableView
设置为静态单元格。
UITableView
set to static cells.
是否可以通过编程方式隐藏部分单元格?
Is it possible to hide some of the cells programmatically?
推荐答案
您正在寻找此解决方案:
You are looking for this solution :
StaticDataTableViewController 2.0
https://github.com/xelvenone/StaticDataTableViewController
可以显示/隐藏/重新加载任何有或没有动画的静态单元格!
which can show/hide/reload any static cell(s) with or without animation!
[self cell:self.outletToMyStaticCell1 setHidden:hide];
[self cell:self.outletToMyStaticCell2 setHidden:hide];
[self reloadDataAnimated:YES];
注意始终只使用(reloadDataAnimated:YES / NO)
(不要叫[self] .tableView reloadData]直接)
Note to always use only (reloadDataAnimated:YES/NO) (dont call [self.tableView reloadData] directly)
这不会使用设置高度为0的hacky解决方案,并允许您设置更改动画并隐藏整个部分
这篇关于UITableView设置为静态单元格。是否有可能以编程方式隐藏一些单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文