Search code examples
iphoneemaillandscapemfmailcomposeviewcontroller

MFMailComposeViewController in landscape on iPhone


I'm using the same code I've seen everywhere else in order to send an email from within my app. My app is always in Landscape. This code works perfectly on the iPad, but not on the iPhone.

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

[picker setSubject:@"App Feedback"];

[self presentModalViewController:picker animated:YES];

On the iPhone, it comes up looking like this: enter image description here

Any help would be greatly appreciated! I've read dozens of other posts and haven't been able to find an answer...


Solution

  • Okay, I did find the answer and have fixed it:

    You have to execute this code in the rootViewController.