Changing MFMailComposeViewController's toolbar color

iYassin picture iYassin · Oct 28, 2009 · Viewed 16.7k times · Source

I'm using a tinted navigation bar and a tinted global UIToolbar in my iPhone app. In my info view, I have a button which opens a MFMailComposeViewController, and the toolbar at the top of that view (with the "cancel" and "send" button) is still blue. I'm calling the MFMailComposeViewController like this:

-(void)displayMailSheet
{

    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:@"..."];

    NSArray *toRecipients = [NSArray arrayWithObject:@"..."]; 

    [picker setToRecipients:toRecipients];

    [self presentModalViewController:picker animated:YES];
    [picker release];

}

Is it possible to change the color of that view's toolbar? If it is possible, how can I do this?

Answer

Sindre Sorhus picture Sindre Sorhus · Nov 15, 2009

Here you go:

[[picker navigationBar] setTintColor:[UIColor blackColor]];

for iOS 8.0

 [[picker navigationBar] setBarTintColor:[UIColor blackColor]];