Skip to content

Instantly share code, notes, and snippets.

@ytlvy
Forked from vinhnx/remove-bottom-line-navbar.md
Last active September 22, 2015 09:51
Show Gist options
  • Save ytlvy/61244c1a748e675c5064 to your computer and use it in GitHub Desktop.
Save ytlvy/61244c1a748e675c5064 to your computer and use it in GitHub Desktop.
remove 1px bottom line of the navigation bar

If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your AppDelegate class to remove the 1 pixel border via the appearance proxy:

[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
                                  forBarPosition:UIBarPositionAny
                                      barMetrics:UIBarMetricsDefault];

[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];

swift

navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarPosition: .Any, barMetrics: .Default)
navigationController?.navigationBar.shadowImage = UIImage()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment