导航栏标题颜色设置

相当出自己刚做开发的时候朋到这个问题时候的解决方案是,

创建一个lable,让导航栏的titleView = lable

改变label的字体颜色,才实现的效果


后来才发现 原来也是有API的,希望能给朋友们带来帮助


self.navigationItem.title = @"hello";

NSDictionary * dic = [NSDictionary dictionaryWithObject:[UIColor orangeColor] forKey:NSForegroundColorAttributeName];
self.navigationController.navigationBar.titleTextAttributes = dic;


[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], UITextAttributeTextColor, nil]];

你可能感兴趣的:(标题颜色,导航栏标题)