很多时候需要设置导航栏的文字。
在网上找了两个记录一下 ,供大家使用。
//这两个都可以
//1
self.navigationItem.title = @"去评价";
//2
self.title = @"aaa";
//设置颜色方式一
[self.navigationController.navigationBar setTitleTextAttributes:@
{
NSForegroundColorAttributeName:[UIColor whiteColor]
}];
//设置颜色方式二
UIColor * color = [UIColor whiteColor];
NSDictionary * dict = [NSDictionary dictionaryWithObject:color forKey:NSForegroundColorAttributeName];
self.navigationController.navigationBar.titleTextAttributes = dict;
// 右侧
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"提交" style:UIBarButtonItemStylePlain target:self action:@selector(tiJiaoBtnClick:)];