views:

338

answers:

2

from this code will show in original color how can i change it to another color? maybe it need to be override?

MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
    mail.mailComposeDelegate = self;
    if ([MFMailComposeViewController canSendMail]) {
        [mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
        [mail setSubject:@"support"];
        [mail setMessageBody:@"enter your message here" isHTML:NO];
        [self presentModalViewController:mail animated:YES];
    }
A: 

I haven't done this so take this answer with appropriate caution.

MFMailComposeViewController inherits from UINavigationController. That means it'll have a navigationBar property. Once you have the navigationBar you can modify its tintColor property.

Giao
i see, thank you Giao
RAGOpoR
You'll nee to be careful when using this approach. Apple are known to be trigger happy with the reject button when submitting to the App Store. If you modify a standard iPhone interface (ie, the mail compoase interface), Apple may reject your application. Provided UI's are not intended to be modified...
Jasarien
+1  A: 

Actually, the iPhone SDK prohibits you from modifying the appearance MFMailComposeViewController. From the docs (here):

Important: The mail composition interface itself is not customizable
and must not be modified by your application. In addition, after
presenting the interface, your application is not allowed to make 
further changes to the email content. The user may still edit the
content using the interface, but programmatic changes are ignored. 
Thus, you must set the values of content fields before presenting 
the interface.

Sorry...

Neal L
interface itself is not customizable,It mean change color of navigationbar ?im not sure about change color will conflict to modified The mail composition interface.
RAGOpoR
That may be true, but practically speaking my experience dealing with the Apple store folks is that you don't want to give them an excuse to deny your app. You may be able to re-tint the nav bar but I would hate to invest a bunch of time into that if it ends up getting your app rejected...
Neal L