您的位置:首页 > 其它

隐藏导航栏最底下的线条

2016-03-30 12:05 761 查看
两种方法可以实现隐藏导航栏最底下的线条

方法1:使用图片或颜色设置

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]];

}

方法2:使用nav自带的方法

self.navigationController.navigationBar.clipsToBounds=YES;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息