Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the Navigation Bar of an UINavigationController display at the bottom?

Is there any way to make the default navigation bar of an UINavigationController display at the bottom instead of the top? I know that there is an UIToolbar that can be displayed at the bottom, but that one is specific to each view and does not carry the "back" button.

like image 395
Valerio Santinelli Avatar asked Dec 27 '22 21:12

Valerio Santinelli


1 Answers

If you create your view using a NIB, then it is rather simple - select navigation bar in attributes->bottom bar. If not then you should access navigation bar directly and change its coordinates. In your view controller:

CGRect oldRect = self.navigationController.navigationBar.frame;
self.navigationController.navigationBar.frame = CGRectMake(x, y, oldRect.width, oldRect.height);

where x and y are coordinates to place your navigation bar.

like image 195
Konstantin Chugalinskiy Avatar answered Jan 13 '23 15:01

Konstantin Chugalinskiy