ios 导航栏透明设置(11及以下)

@property (nonatomic,strong)UIImageView * barImageView;

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    if (@available(iOS 11.0, *)) {
        [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
        [[self.navigationController.navigationBar.subviews objectAtIndex:0] setAlpha:0];
        [self.navigationController.navigationBar setShadowImage:[[UIImage alloc]init]];
    }else{
        self.barImageView = self.navigationController.navigationBar.subviews.firstObject;
        self.barImageView.alpha = 0;
        
    }
    [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
}

你可能感兴趣的:(ios 导航栏透明设置(11及以下))