No matter what I seem to try, in the email screen that comes up when a user chooses to email a link (it's a MFMailComposeViewController
) the buttons are always the default blue.
I have this in my 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] }];
And it does indeed color the title of the MFMailComposeViewController
but not the buttons. How do I accomplish that?
It also keeps my status bar black when I have it white everywhere else.
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];
}];
Since iOS 6, MFMailComposeViewController (and some other view controllers) are run on a separate process, as such they will not inherit the style used in your app. Using the above method may help, it does, at least work on iOS 7, assuming you're using the most up-to-date SDK. You can read more about remote view controllers here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With