2018-05-28 iOS 去除导航栏下面的黑线

-(void)viewWillAppear:(BOOL)animated

{

    [superviewWillAppear:animated];


    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];

    [self.navigationController.navigationBar setShadowImage:[UIImage new]];

}

-(void)viewDidDisappear:(BOOL)animated

{

    [super viewDidDisappear:YES];

    [self.navigationController.navigationBar setShadowImage:nil];

      [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];


}

你可能感兴趣的:(2018-05-28 iOS 去除导航栏下面的黑线)