I have an app that sometimes needs its navigation bar to blend in with the content.
Does anyone know how to get rid of or to change color of this annoying little bar?
On the image below situation i have - i'm talking about this 1px height line below "Root View Controller"
In iOS8, if you set the
UINavigationBar.barStyle
to.Black
you can set the bar's background as plain color without the border.In Swift:
After studying the answer from Serhil, I created a pod UINavigationBar+Addition that can easily hide the hairline.
In Swift 3.0
Edit your
AppDelegate.swift
by adding the following code to your application function:Swift 4 //for hiding navigation bar shadow line
Swift 4 Tested ONE LINE SOLUTION
In
Viewdidload()
Set Navigation controller's userdefault value true for key "hidesShadow"