How can I modify the appearance of 'empty' cells in plain UITableView?

前端 未结 8 2248
广开言路
广开言路 2020-12-08 21:18

If you have a plain (not grouped) UITableView with a single row, the rest of the screen is filled with blank or empty cells. How do you change the appearance of these blank

相关标签:
8条回答
  • 2020-12-08 21:55

    For swift 4.0 :

    self.tableView.tableFooterView = UIView(frame: CGRect.zero)
    0 讨论(0)
  • 2020-12-08 22:01

    If you simply want to change the height of the "empty cells" when there are no cells at all in your TableView: you need to set the rowHeight property of your UITableView (the implementation of tableView:heightForRowAtIndexPath: has no effect on empty TableViews). If there are cells in your TableView and you have implemented tableView:heightForRowAtIndexPath: then the last row height will be used for empty cells.

    0 讨论(0)
提交回复
热议问题