使用系统导航栏,设置成全透明的方法

1、先设置系统导航卡全透明   

self.navigationController.navigationBar.translucent  = YES;

        self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],NSFontAttributeName :[UIFont boldSystemFontOfSize:20]};

2、给系统导航栏添加一张全透明的图,nav就是一张全透明的背景图,UIBarMetricsDefault一定要设置成这个模式

        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav"] forBarMetrics:UIBarMetricsDefault];

        self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

3、以上设置可以实现效果,但是有一个缺陷就是,导航栏下方会有1像素的白线,加上这句话就可以了

        self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];

原文地址:https://www.cnblogs.com/angongIT/p/5141801.html