当打开 UITableViewController
时,我想显示一个屏幕,上面写着“这里什么都没有”(参见下面的 Dropbox 应用程序的屏幕截图),而不是在没有部分/行时显示空行.这已经在多个应用程序中完成,但我想知道是否有推荐的实现方法。
我可以想出多种方法,包括
- 将
UIView
作为 subview 添加到 tableViewController 的 View 中 - 切换到
UIViewController
并自行实现 tableView 行为 - 将
UIView
设置为backgroundView
并隐藏 tableView 单元格
感谢您的所有想法!
最佳答案
我通常采用的方式是在没有任何内容可显示时显示单个自定义单元格。
关于ios - 最佳方法 : Displaying a "nothing here, yet" screen instead of empty tableView cells,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15781684/