iOS 设置导航栏透明

    //设置导航栏透明
    [self.navigationController.navigationBar setTranslucent:true];
    //把背景设为空
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    //处理导航栏有条线的问题
    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
//1。
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];//设置NavigationBar上的title的颜色
//2.
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];

//视图将要出现,隐藏导航栏

 

-(void)viewWillAppear:(BOOL)animated

{

    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES];

}


 

posted on 2018-09-18 20:07  高彰  阅读(5137)  评论(0编辑  收藏  举报

导航