The below image shows the top of my viewController and interestingly the title "Example" is moved outside of the Navigation Controller area (darker blue). The light blue area (where the text is now) should not be there, instead the image should be just lining up since I set the layout constraint to 0 between the top layout guide and the image. There is not really any code, this is just done in Main Storyboard. The viewController you can see below was imbedded in a NavigationController (hence the navigation bar).
I tried things like the below to somehow get rid of the Navigation bar all together, but it did not work:
navigationController?.navigationBar.isTranslucent = true
or
self.navigationController?.view.backgroundColor = UIColor.clear
or set the title programmatically rather than in the Main Storyboard:
self.title = "Example Resources"
I also tried to reduce the height of the Navigation bar with this:
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
let height: CGFloat = 20 //whatever height you want
let bounds = self.navigationController!.navigationBar.bounds
self.navigationController?.navigationBar.frame = CGRect(x: 0, y: 0, width: bounds.width, height: bounds.height + height)
}
But that did not do anything.
I am tapping in the dark. Can anybody explain why the text is outside my Navigationcontroller titlebar??