MFMailComposeViewController bar background color not changing in iOS7 MFMailComposeViewController bar background color not changing in iOS7 ios ios

MFMailComposeViewController bar background color not changing in iOS7


The trick here is to call 'appearance methods' such as

[UINavigationBar appearance].barTintColor = [UIColor whiteColor];[UINavigationBar appearance].tintColor = [UIColor redColor];

BEFORE calling to

[[MFMailComposeViewController alloc] init];

This way the color scheme will be applied to the mail composer.It may be returned back to defaults in mailComposeController:didFinishWithResult:


try this. worked for me.

MFMailComposeViewController* myailViewController = [[MFMailComposeViewController alloc] init];// set other attributes of mailcomposer here.myMailViewController.mailComposeDelegate = self;[myMailViewController.navigationBar setTintColor:[UIColor whiteColor]];[self presentViewController:myMmailViewController animated:YES completion:nil];


Swift 3 solution:

extension MFMailComposeViewController {    override open func viewDidAppear(_ animated: Bool) {        super.viewDidAppear(animated)        UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent    }    open override func viewDidLoad() {        super.viewDidLoad()        navigationBar.isTranslucent = false        navigationBar.isOpaque = false        navigationBar.barTintColor = UIColor.white        navigationBar.tintColor = UIColor.white    }}


matomo