方案1:
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSFontAttributeName:[UIFont systemFontOfSize:19.0f],
NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"]}];
方案2:在导航上添加一个titleView,可以使用一个UILable,再设置label的背景颜色透明,字体,即:自定义一个自定义标题视图
UILabel *titleLabel = [[UILabel
alloc] initWithFrame:CGRectMake(0,
0, 200, 44)];
// 设置titleLabel的各种属性
xxxxxx
xxxxx
xxx
// 最后
self.navigationItem.titleView = titleLabel;
网友评论