[[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]}];
UIImage *bgImage = [ColorImageHelper createImageWithColor:[UIColor greenColor] rect:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.width, 64)];
[[UINavigationBar appearance] setBackgroundImage:bgImage forBarMetrics:UIBarMetricsDefault];
UIImage *shadowImage = [ColorImageHelper createImageWithColor:[UIColor redColor] rect:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.width, 0.5)];
[[UINavigationBar appearance] setShadowImage:shadowImage];
//[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; //可以隐藏底部线条
+ (UIImage*) createImageWithColor:(UIColor*)color rect:(CGRect)rect {
//CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);//Image高宽为(1,1)
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *theImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return theImage;
}