iOS开发隐藏navigationBar下方的分割线

-(void)viewWillAppear:(BOOL)animated{
  [super viewWillAppear:animated];
//    //设置导航栏背景图片为一个空的image,这样就透明了
  [self.navigationController.navigationBar setBackgroundImage:  [UIImage new] forBarMetrics:UIBarMetricsDefault];
//去掉透明后导航栏下边的黑边
  [self.navigationController.navigationBar setShadowImage:[UIImage new]];

}
-(void)viewWillDisappear:(BOOL)animated{
  [super viewWillDisappear:animated];
//设置导航栏背景图片为一个空的image,这样就透明了
  [self.navigationController.navigationBar setBackgroundImage:    [UIImage new] forBarMetrics:UIBarMetricsDefault];
//去掉透明后导航栏下边的黑边
  [self.navigationController.navigationBar setShadowImage:[UIImage new]];
}

推荐阅读更多精彩内容