Appearance of MFMailComposeViewController setTintColor is lost iOS 7

This question for Xcode 5 is running iOS 7 and is super weird. I am trying to set all the colors of the text UInavigation and UIBarButtonItem to white.

So, in my application launch application, I install the code as.

- (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; } 

If I run the Send Mail action twice - The first time I see UIBarButton elements are white. I look at him and click the "Cancel" button - the second time I see that they are all gray and barely noticeable, except for the name. - This happens both on my iPhone simulator and on an iPhone running iOS 7.

how can i fix this?

enter image description hereenter image description here

+4
source share
1 answer

I had to do it in such a way that it worked on iOS 7

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

Source: https://habr.com/ru/post/955772/


All Articles