How to add a toolbar to the bottom of a UITableViewController in Storyboards?

前端 未结 6 1948
温柔的废话
温柔的废话 2020-12-04 14:21

In my UITableView that I have setup using Storyboards, I need to be able to add a tool bar that sticks to the bottom of the view, it should not scroll.

6条回答
  •  暖寄归人
    2020-12-04 15:02

    For Swift users, you can use the following code:

    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated);
        self.navigationController?.setToolbarHidden(false, animated: animated)
    }
    
    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated);
        self.navigationController?.setToolbarHidden(true, animated: animated)
    }
    

提交回复
热议问题