Remove UINavigationBar border

1.4k views Asked by At

There is a thin gray border in the bottom of UINavigatioBar: enter image description here

I can't remove it!

I've tried:

self.navigationController?.navigationBar.layer.borderColor =
 UIColor.orangeColor().CGColor
self.navigationController?.navigationBar.layer.borderWidth = 0

With no chance.

1

There are 1 answers

3
Nakib On

It should work

 self.navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
 self.navigationController?.navigationBar.shadowImage = UIImage()

Add this line for background color (Change rgb value of your choice)

self.navigationController?.navigationBar.barTintColor = UIColor(rgba: "#000000")