Add button on top of UITableViewController (Swift)

前端 未结 8 1074
夕颜
夕颜 2021-02-07 15:34

I am trying to add a button ontop of a uitableview controller table view. The view controller has a navigation controller and static cells, which is why it is a uitableviewcontr

8条回答
  •  逝去的感伤
    2021-02-07 16:13

    all you need to do is to add your Top view whichever it is to the navigationController.view like so:

    self.navigationController?.view.addSubview(YOUR_TOP_VIEW)
    

    so if you need a sticky button/view etc... on top of TableViewController which does not scroll with tableView, use this approach.

提交回复
热议问题