如何从默认的蓝色为MFMailComposeViewController的UIBarButtonItems的颜色?

无论我看起来如何尝试,在用户select通过电子邮件发送链接(这是一个MFMailComposeViewController )时出现的电子邮件屏幕中,button始终是默认的蓝色。

我在我的AppDelegate中有这个:

 [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0.000 green:156/255.0 blue:51/255.0 alpha:1]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; [[UINavigationBar appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName: [UIColor whiteColor] }]; 

它的确确实着色了MFMailComposeViewController的标题,而不是button。 我如何做到这一点?

当我在其他地方有白色时,它也保持我的状态栏黑色。

 MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init]; mailController.mailComposeDelegate = self; [mailController setToRecipients: [NSArray arrayWithObjects:@"recipients", nil]]; [mailController setSubject: @"Contact Us"]; [mailController setMessageBody: @"Mail Body" isHTML:NO]; [[mailController navigationBar] setTintColor: [UIColor blackColor]]; //color [self presentViewController: mailController animated:YES completion:^{ [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent]; }]; 

从iOS 6开始,MFMailComposeViewController(和一些其他视图控制器)在单独的进程上运行,因此它们不会inheritance应用程序中使用的样式。 使用上面的方法可能会有所帮助,至less可以在iOS 7上工作,假设您使用的是最新的SDK。 您可以在这里阅读更多关于远程视图控制器。