// 方法1:
[barAttrs setObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
[barAttrs setObject:[NSValue valueWithUIOffset:UIOffsetMake(0, 0)] forKey:UITextAttributeTextShadowOffset];
[self.navigationController.navigationBar setTitleTextAttributes:barAttrs];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],
NSForegroundColorAttributeName,nil]];
// 方法3:直接重写setTitle:方法
- (void)setTitle:(NSString *)title
{
[super setTitle:title];
UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectZero];
titleLabel.textColor = [UIColor whiteColor];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
titleLabel.text = title;
[titleLabel sizeToFit]; // 自动适应大小
self.navigationItem.titleView = titleLabel;
}