Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "Dock" a UIToolbar to the bottom of the screen in UITableView?

I have a UIToolbar that I added to a UITableViewController in my Storyboard.

Toolbar Location

When this view is displayed, the toolbar will show itself directly below the last item in my UITableView. I want to "Dock" my toolbar on the bottom of the screen. I want it to display in the same place every time rather than move around depending on a variable number of table cells in my view. I need the user to be able to see all the cells as well (It can't be covering UITableView items, UITableView needs to decrease its allotted display space). How can I do this?

Edit: Using a UINavigationController to handle my views

like image 783
GWhite Avatar asked Oct 16 '13 20:10

GWhite


1 Answers

You have a couple of options. The first and easiest of the two would be to use a UITableViewController embedded inside a UINavigationController, with the navigation controllers toolbarHidden property set to NO.

The other option is to use a UIViewController. A view controller has a UIView build in, and you can manually add and position a UITableView and a UIToolbar on it in this configuration. Both of these configurations will achieve your desired end result.

like image 121
Mick MacCallum Avatar answered Nov 15 '22 11:11

Mick MacCallum