Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

Unlike this question: LINK I don't think I could add a TableView subview to a normal view and then just add a toolbar programmatically because I am using dynamic cells which seem a lot easier to integrate via Storyboards.

For now, this is what I am stuck with.... enter image description here

like image 869
vzm Avatar asked Oct 28 '13 00:10

vzm


People also ask

How do I add a navigation controller to my storyboard?

Under the View menu, select Utilities→Show Object Library. In the Object Library, find the Navigation Controller object (see Figure 4-7) and drag and drop it into the storyboard, to the left side of your existing view controller (Figure 4-6).


2 Answers

if you want show toolbar in one view controller which placed in some navigation controller.

  1. select view controller in storyboard
  2. in utilities, show "attribute inspector". select "bottom bar" style.
  3. add bar button item
  4. add code in view controller, to show and hide toolbar:

code:

- (void)viewWillAppear:(BOOL)animated {     [self.navigationController setToolbarHidden:NO animated:YES]; }  - (void)viewWillDisappear:(BOOL)animated {     [self.navigationController setToolbarHidden:YES animated:YES]; } 
like image 72
Zoxaer Avatar answered Sep 22 '22 18:09

Zoxaer


Very easy. Just click on the navigation controller. Then in Show Attributes Inspector then navigation controller then click on the shows toolbar. Check the screen shot.

Show Toolbar Screen Shot

like image 37
Kegham K. Avatar answered Sep 21 '22 18:09

Kegham K.