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

前端 未结 6 1942
温柔的废话
温柔的废话 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:11

    1. Drag a UIViewController into Storyboard
    2. Drag a UIToolbar on top of the Storyboard's contents.
    3. Drag a UITableView on top of the Storyboard's contents.
    4. Link the tableview's delegate and datasource to your source code.

    Although you won't be able to use UITableViewController as your linking class step 4 will allow you to link it to a regular UIViewController.

    You'll need something like this in the header though

    @interface MyViewController : UIViewController 
    

    It'll look something like this in your storyboard:

    enter image description here

提交回复
热议问题