How to remove extra empty cells in TableViewController, iOS - Swift

后端 未结 13 1044
暗喜
暗喜 2020-12-22 16:12

Hi I have a TableViewController with two static cells, however when displayed, it shows the two static cells, and then all the other empty cells for the tablevi

13条回答
  •  梦毁少年i
    2020-12-22 16:13

    Setting the tableFooterView should remove extra cell like views.

       @IBOutlet weak var tableView: UITableView! {
            didSet {
                tableView.tableFooterView = UIView(frame: .zero)
            }
        }
    

提交回复
热议问题