0

I'm trying to change the UINavigationBar height. I found various solutions to solve this but none of them worked/made my app crash.

For Example how to increase the height of navigation bar in xcode?

I'm using iOS 11/10/9 by the way...

Thanks (:

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
Gal Shahar
  • 2,695
  • 1
  • 21
  • 29
  • What error in the crash? In what line of code? – biloshkurskyi.ss Dec 07 '17 at 20:18
  • Have you used navigationController in your screen? – biloshkurskyi.ss Dec 07 '17 at 20:19
  • I added a navigation controller to the storyboard, just dragged and dropped, and about the errors: – Gal Shahar Dec 07 '17 at 20:20
  • for subview in (self.navigationController?.navigationBar.subviews)! { if NSStringFromClass(subview.classForCoder).contains("BarBackground") { var subViewFrame: CGRect = subview.frame // subViewFrame.origin.y = -20; subViewFrame.size.height = 100 subview.frame = subViewFrame } } Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1005ff.....) – Gal Shahar Dec 07 '17 at 20:21
  • And if I run this code, I just get the Unexpectedly found nil exception for the navigationController! -> self.navigationController!.navigationBar.frame = CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 80.0) @biloshkurskyi.ss – Gal Shahar Dec 07 '17 at 20:24
  • Check this [thred](https://forums.developer.apple.com/thread/88202) – biloshkurskyi.ss Dec 07 '17 at 20:47
  • I think you should create a custom navigation bar and use it – biloshkurskyi.ss Dec 07 '17 at 20:48

0 Answers0