How can we hide the tableHeaderView and tableFooterView?

前端 未结 8 535
我在风中等你
我在风中等你 2020-12-08 10:32

I have two buttons which i add it in one in table-footer and other one in table-header,i know how to hide the headerview of the table using this codetable.tableHeader

8条回答
  •  一个人的身影
    2020-12-08 10:46

    If you created your view in storyboard, you can hide it temporary with

    tableView.tableHeaderView?.frame = CGRect.zero

    To display it again, use

    tableView.tableHeaderView?.frame = CGRect(x: 0, y: 0, width: tableView.frame.width, height: 50)

提交回复
热议问题