Reputation: 53
I want remove border of navigation bar. I am using this code in AppDelegate.m
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
and it works well. It removes border of navigation bar in every view controller. But i have to remove it for few view controllers.
By placing this code in viewWillAppear of particular view controller, its not working. Does anyone knows how to do it?
Upvotes: 2
Views: 65
Reputation: 1837
You should set the background image and shadow image of the navigation bar in your select navigations bars and not to use the appearance method. e.g.:
[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
forBarMetrics:UIBarMetricsDefault];
Upvotes: 1