0

I cannot understand why navigationBar's height does not change from default to 100. I would be happy if you have any answer. my code is below,

let mainNavController: UINavigationController = UINavigationController(navigationBarClass: CustomNavigationBar.self, toolbarClass: nil)
    mainNavController.setViewControllers([ViewController], animated: false)

and also

class CustomNavigationBar: UINavigationBar {
override func sizeThatFits(_ size: CGSize) -> CGSize {
    var size = super.sizeThatFits(size)
    size.height = 100
    return size
    }
}
  • Possible duplicate of [iOS 11 navigation bar height customizing](https://stackoverflow.com/questions/44387285/ios-11-navigation-bar-height-customizing) – Tamás Sengel Sep 30 '17 at 13:59
  • Check this : https://stackoverflow.com/questions/40751366/how-can-i-change-height-of-navigation-bar-swift-3 – Amit Sep 30 '17 at 14:09
  • I cannot see there seems to be any difference between my code and your reference. I want to know why my code doesn't work. – Kotaro Harada Oct 01 '17 at 11:50

0 Answers0