Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Toolbar to Navigation Controller

Sup fellas, so I have a navigation controller with a table view to which I am trying to add a tool bar, however, the way I have implemented it causes the very last row in the table to be hidden behind the tool bar. I will try to illustrate via pictures:

Table view scrolled to the bottom without tool bar:

alt text

Table view scrolled to the bottom with tool bar(notice how the last "Vendor" row is concealed behind the tool bar):

alt text

I was following this guide and this is what I ended up doing for my implementation:

alt text

As you can see I have a "View" instead of "Window" to work with. Here is the code I have for displaying the tool bar:

- (void)viewDidLoad {
    [super viewDidLoad];
 [self.view addSubview:self.navigationController.view];
 [self.view addSubview:toolbar];
 [self.navigationController.view setFrame:self.view.frame];
}

It seems to me that I need to adjust the frame of the navigation controller frame to compensate for the tool bar being at the bottom. This is where I am stuck. How would I go about doing this? Any help appreciated!

like image 431
Stunner Avatar asked May 04 '26 08:05

Stunner


1 Answers

If you add the toolbar to the navigation controller, it will automatically resize itself. Just check this box in IB.

Check "Shows Toolbar" box in IB

like image 199
ughoavgfhw Avatar answered May 05 '26 23:05

ughoavgfhw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!