【设置导航栏颜色/图片、文字颜色】
设置导航栏颜色会同时设置标题栏背景色
//设置导航栏背景颜色
nc.navigationBar.barTintColor = [UIColor whiteColor];
//设置导航栏背景图片
nc.navigationBar.barTintColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.jpg"]];
//设置导航栏文字颜色
nc.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
以上情况用于UIviewController外部设置,当在内部时,可以用
self.navigationController代替上面的“nc”对象