如何在UITableView中隐藏一个部分? [英] How to hide a section in UITableView?
本文介绍了如何在UITableView中隐藏一个部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
表格中有一些部分不包含任何数据,并希望隐藏该部分。
There are some section in the table that does not contain any data and would like to hide that section.
如何做到这一点?
推荐答案
您不能隐藏某个部分,但可以使用从表格视图中删除它deleteSections:withRowAnimation:
方法。这将使用可选动画将其从视图中删除,而不会影响您的支持数据。 (但是,您应该更新数据,以便该部分不再出现。)
You can't "hide" a section as such, but you can "delete" it from the table view using the deleteSections:withRowAnimation:
method. This will remove it from the view, with an optional animation, without affecting your backing data. (You should, however, update the data anyway so that the section doesn't reappear.)
更多信息: UITableView类参考
这篇关于如何在UITableView中隐藏一个部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文