user1078065
user1078065

Reputation: 412

MFMailComposeViewController navigationBar

My app has a custom background for the navigation bar. So i made a category like this

@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect 
{
    UIImage *image = [UIImage imageNamed: @"image.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end

In my app I have to use MFMailComposeViewController. I create it like

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];

But Apple's docs state that

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.

So this mean I can't keep my "image.png" as the navigation bar background for the mail composer view controller.

How one can accomplish this?

Thanks

Upvotes: 2

Views: 1948

Answers (1)

George Green
George Green

Reputation: 4905

Using the standard apple MFMailComposeViewController you can't, to put it simply. You would normally present it modally so it would go completely over your view anyway.

If you wanted a custom looking compose sheet, you would have to create it as a custom controller with a custom view. You would also need either a mail server built into your app, or a server that you can hit to send the mail for you.

For security reasons apple limit what you can do with MFMailComposeViewController.

If I can be of more help, please do ask :)

Upvotes: 2

Related Questions