天天看点

设置导航栏颜色和字体颜色

self.navigationController.navigationBar.barTintColor = [UIColor blueColor];

//    // 导航栏背景

//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navigationImage_2.png"] forBarMetrics:UIBarMetricsDefault];

//    

//    self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

//    // 导航栏透明

//    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"talk_icon_03.png"] forBarMetrics:UIBarMetricsCompact];

//    // 设置样式,不加这句话会有横线

    // 修改title字体颜色

    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];

    self.navigationController.navigationBar.barTintColor = HexRGB(0X62ccca);

    // 修改返回箭头颜色样式

    UIImage *backButtonImage = [[UIImage imageNamed:@"talk_icon_03.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 30, 0, 0)];

    [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];

本文转自 卓行天下  51CTO博客,原文链接:http://blog.51cto.com/9951038/1768207,如需转载请自行联系原作者

继续阅读