Add button on top of UITableViewController (Swift)

前端 未结 8 2036
盖世英雄少女心
盖世英雄少女心 2021-02-07 16:02

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:19

    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.

提交回复
热议问题