Ios 更改目标c中的视图控制器标题颜色
我想改变视图控制器标题的颜色,就像这个黑色的一样Ios 更改目标c中的视图控制器标题颜色,ios,user-interface,uiviewcontroller,Ios,User Interface,Uiviewcontroller,我想改变视图控制器标题的颜色,就像这个黑色的一样 尝试此操作,在ViewWillDisplay函数中添加此代码:- 根据您的字体传递字体名称 [self.navigationController.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:[UIColor blackColor], NSFontAttributeName:[UIFont fontWithName:@"Helvetica-regul
尝试此操作,在ViewWillDisplay函数中添加此代码:- 根据您的字体传递字体名称
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor blackColor],
NSFontAttributeName:[UIFont fontWithName:@"Helvetica-regular" size:17]}];
仅为一个视图控制器更改标题颜色: 在
视图中使用以下代码将出现
[self.navigationController.navigationBar setTitleTextAttributes:
@{NSForegroundColorAttributeName:[UIColor blackColor]}];
整个应用程序的标题颜色更改:
在didfishLaunching
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]}];
?