0

I'm trying to increase the navigation bar in my project with:

navigationBar?.frame.origin.y = +50

But it also change the left bar button item. Is there any way to move it back to the original position?

Image of the original navigation bar

And then:

Image of the navigation bar after the increasing

Bhavin Ramani
  • 3,221
  • 5
  • 30
  • 41
s_s
  • 709
  • 1
  • 7
  • 13
  • 2
    why would you do that?! you can hide the navigation bar and add your custom view – Ahmad F Oct 19 '16 at 11:57
  • 1
    follow this link its may be helpfull for u http://stackoverflow.com/questions/6566216/vertically-aligning-uinavigationitems/17434530#17434530 – Amit Srivastava Oct 19 '16 at 12:01
  • @AhmadF It has a limitation though. If you add a loader on uiview, it will block the complete view. With standard navigation bar adding loader on UIView doesnt block the nav bar taps. If you want to do something like this, make a container of nav bar and add controllers as child – Rajan Maheshwari Oct 19 '16 at 12:20
  • I will create custom navigation bar after hiding the default navigation bar. Looks like it is the best option. Thanks for your help! – s_s Oct 20 '16 at 12:14

1 Answers1

0

If you want to totally customized navigation bar then you should hide default navigation bar and you can use UIView work as NavigationBar. You can set desired height to it and you should keep it's width equal to your screen width. You should then add UIButton on that view at your desired position working as back button or other function!

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75
  • It has a limitation though. If you add a loader on uiview, it will block the complete view. With standard navigation bar adding loader on UIView doesnt block the nav bar taps. If you want to do something like this, make a container of nav bar and add controllers as child – Rajan Maheshwari Oct 19 '16 at 12:17
  • I will create custom navigation bar after hiding the default navigation bar. Looks like it is the best option. Thanks for your help! – s_s Oct 20 '16 at 12:15