MFMailComposeViewController外观setTintColor迷失iOS 7

这个问题是运行iOS 7的Xcode 5,是超级怪异的。 我正在尝试将所有UInavigation和UIBarButtonItem文本颜色设置为白色。

所以在我的应用程序启动委托我设置代码为。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIImage *NavigationPortraitBackground = [UIImage imageNamed:@"button_header_blue"]; // Set the background image all UINavigationBars [[UINavigationBar appearance] setBackgroundImage:NavigationPortraitBackground forBarMetrics:UIBarMetricsDefault]; // Set the text appearance for navbar [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], UITextAttributeTextColor, [UIColor whiteColor], UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, 0)], UITextAttributeTextShadowOffset, [UIFont fontWithName:@"Helvetica Neue" size:21], UITextAttributeFont, nil]]; [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], UITextAttributeTextColor, [UIColor whiteColor], UITextAttributeTextShadowColor, nil]; [[UIBarButtonItem appearance] setTitleTextAttributes:attributes forState: UIControlStateNormal]; [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; // Override point for customization after application launch. return YES; } 

如果我两次启动“发送邮件”动作 – 第一次看到UIBarButton项目是白色的。 我看着它,并点击取消button – 第二次看到他们都变灰,除了标题几乎可见。 – 我的iPhone模拟器和运行iOS 7的iPhone都出现这种情况。

我怎样才能解决这个问题?

在这里输入图像说明在这里输入图像说明

我必须这样做才能在iOS 7上工作

 if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; mailViewController.mailComposeDelegate = self; [mailViewController.navigationBar setTintColor:[UIColor whiteColor]]; [mailViewController.navigationBar setBarTintColor:[UIColor whiteColor]]; ....