IOS 去掉导航栏(UINavigationBar)下方的横线

Posted 飘金

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IOS 去掉导航栏(UINavigationBar)下方的横线相关的知识,希望对你有一定的参考价值。

这是导航栏的问题,将下边的代码放在  viewWillAppear  方法中就可以实现效果:

 

 

- (void)viewWillAppear:(BOOL)animated{

    

    // Called when the view is about to made visible. Default does nothing    

    [super viewWillAppear:animated];

  

    //去除导航栏下方的横线

    [navigationBar setBackgroundImage:[UIImage imageWithColor:[self colorFromHexRGB:@"33cccc"]]

                       forBarPosition:UIBarPositionAny

                           barMetrics:UIBarMetricsDefault];

    [navigationBar setShadowImage:[UIImage new]];

    

}

以上是关于IOS 去掉导航栏(UINavigationBar)下方的横线的主要内容,如果未能解决你的问题,请参考以下文章