Changing the appearance of a MFMailComposer through normal measures is not possible, but there is a little workaround you can do, which I've used many times before.
Add two methods to the class in which you wish to implement the new look to:
- (void)applyComposerInterfaceAppearance
{
[[UINavigationBar appearance] setTintColor:[UIColor blueColor]];
}
- (void)applyGlobalInterfaceAppearance
{
// My default color of choice
[[UINavigationBar appearance] setTintColor:[UIColor redColor]];
}
Now in your show method, apply the special composer interface changes you'd like to make.
- (void)showMailComposer
{
if ([MFMailComposeViewController canSendMail])
{
[self applyComposerInterfaceApperance];
MFMailComposeViewController *viewController = [[MFMailComposeViewController alloc] init];
viewController.mailComposeDelegate = delegate;
[viewController setToRecipients:mailRecepients];
[viewController setSubject:mailSubject];
[viewController setMessageBody:messageBody isHTML:NO];
[self presentModalViewController:viewController animated:YES];
}
}
And in your delegate, change the interface back to the way it was.
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
// Do normal mail composer did finish stuff in here
[self applyGlobalInterfaceAppearance];
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…