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

后端 未结 13 1072
暗喜
暗喜 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
    慢半拍i (楼主)
    2020-12-22 16:25

    Simply add:

    tableView.tableFooterView = UIView()
    

    Explanation:

    This is totally valid and works perfectly in swift 3.By Since you are setting an empty UIView() object to the property, Setting tableFooterView to UIView() removes the rows.

提交回复
热议问题