0

I am trying to change the height of the navigation bar with this code provided in few links over stackoverflow, but it is not working as required.

self.navigationController?.navigationBar.frame = CGRect(x: self.view.frame.origin.x, y: self.view.frame.origin.y, width: self.view.frame.size.width, height: 200)
self.navigationController?.navigationBar.layoutIfNeeded()

Is there anything additional that I need to add to make it work ?

I did checked the reference link too but it is not working, also it is the same as I written with added fix.

Gurjot Kalsi
  • 33
  • 11

1 Answers1

0

The hierarchy of UINavigationBar view is private so we can't manipulate it.We create our custom view and add into a Viewcontroller.

Khawar Islam
  • 2,556
  • 2
  • 34
  • 56