答案 0 :(得分:0)
尝试在viewWillAppear函数中添加此代码: -
根据您的字体传递字体名称
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor blackColor],
NSFontAttributeName:[UIFont fontWithName:@"Helvetica-regular" size:17]}];
答案 1 :(得分:0)
仅一个视图控制器的标题颜色更改:
在viewWillAppear
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor blackColor]}];
整个应用程序的标题颜色更改:
在didFinishLaunching
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];