美文网首页
修改导航栏itme的颜色、字体 、返回按钮颜色

修改导航栏itme的颜色、字体 、返回按钮颜色

作者: 梦月落花LOVE | 来源:发表于2016-05-23 22:52 被阅读397次

注意:需要写在父类里面才可以哦
注意:需要写在父类里面才可以哦
注意:需要写在父类里面才可以哦

重要的事说三遍,三遍,三遍。

设置导航栏的标题的字体、颜色

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

设置导航栏的tint颜色

[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.2684 green:0.6312 blue:1.0 alpha:1.0]];

设置导航栏的返回按钮

UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
[item setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateNormal];
self.navigationItem.backBarButtonItem = item;

更改导航栏的返回图标"<"的颜色

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

相关文章

网友评论

      本文标题:修改导航栏itme的颜色、字体 、返回按钮颜色

      本文链接:https://www.haomeiwen.com/subject/tytzrttx.html