iOS 导航栏设置

    // 取出appearance对象
    UINavigationBar *navBar = [UINavigationBar appearance];
    
    // 设置tintColor
    [navBar setTintColor:[UIColor blackColor]];
    
    // 导航栏显示成clearColor
    UIImage *image = [UIImage imageWithFillColor:[UIColor clearColor] size:CGSizeMake(MAIN_SCR_W, 64)];
    [navBar setBackgroundColor:[UIColor clearColor]];
    [navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
    // 去掉导航栏下面那条线
    [navBar setShadowImage:[[UIImage alloc] init]];

你可能感兴趣的:(ios)