Reputation: 428
I would like to delete this junction (The line between the navigation bar and the ImageView Orange):
Is there someone who knows how to do?
Upvotes: 0
Views: 2258
Reputation: 2139
Add below lines in your viewWillAppear
self.navigationController?.navigationBar.shadowImage = UIImage()
Upvotes: 2
Reputation: 341
for parent in self.navigationController!.navigationBar.subviews {
for childView in parent.subviews {
if(childView is UIImageView) {
childView.removeFromSuperview()
}
}
}
Upvotes: 1
Reputation: 762
In my case, I implemented the following code.
override func viewDidLoad() {
super.viewDidLoad()
if self.navigationController != nil {
hideBorder(self.navigationController!.navigationBar)
}
}
func hideBorder(view: UIView) -> Bool {
if view.isKindOfClass(UIImageView.classForCoder()) && view.frame.size.height <= 1 {
view.hidden = true
return true
}
for sub in view.subviews {
if hideBorder(sub as! UIView) {
return true
}
}
return false
}
Upvotes: 2
Reputation: 23053
Modify AppDelegate
file and add below code:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
// Change status bar color to white
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent
// To remove separtor line between navigation controller and view
UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)
UINavigationBar.appearance().shadowImage = UIImage()
return true
}
Upvotes: 2