您的位置:首页 > 产品设计 > UI/UE

iOS UINavigationController修改导航栏标题、按钮文字以及背景的颜色

2016-08-19 14:02 519 查看
//方法一

- (void)setNav {

    // 导航栏背景颜色

    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.000 green:0.800blue:0.800 alpha:1.000]];

    // 导航栏标题字体颜色

    [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFontsystemFontOfSize:19],NSForegroundColorAttributeName:[UIColor whiteColor]}];

    // 导航栏左右按钮字体颜色

    self.navigationController.navigationBar.tintColor =
[UIColor whiteColor];

}

//方法二

//设置导航栏背景颜色

UINavigationBar *bar = [UINavigationBarappearance];

bar.barTintColor = [UIColorcolorWithRed:62/255.0green:173/255.0blue:176/255.0alpha:1.0];

//设置字体颜色

bar.tintColor = [UIColorwhiteColor];

[bar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: