Note that there are some explanatory texts on larger screens.

plurals
  1. POMFMailComposeViewController rotation
    primarykey
    data
    text
    <p>Details - - iOS - 4.2, Xcode - 3.2.5, Device - iPad 2, Platform - openFrameworks</p> <p>I'm using MFMailComposeViewController to email a screengrab as an attachment. It's working fine but I'm having issues with rotation.</p> <p>My MFMailComposeViewController was added to a viewController for a panel which resides at the top of the screen for each orientation. As a result, the MFMailComposeViewController always appears in the correct orientation which is perfect. The problem appears when the Cancel button is pressed. The options always appear as if the orientation is portrait. This image was taken when viewed in landscape.</p> <p><a href="http://augmatic.co.uk/store/ipad_email_rotation.jpg" rel="nofollow">http://augmatic.co.uk/store/ipad_email_rotation.jpg</a></p> <p>Here is the code:</p> <pre><code>UIImage* screenGrab = app-&gt;visualsManager-&gt;getScreenGrab(); MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; picker.modalPresentationStyle = UIModalPresentationFullScreen; [picker setSubject:@"Check out this image!"]; NSArray *toRecipients = [NSArray arrayWithObject:@"test@email.com"]; [picker setToRecipients:toRecipients]; NSData *myData = UIImagePNGRepresentation(screenGrab); [picker addAttachmentData:myData mimeType:@"image/png" fileName:@"image.png"]; NSString *emailBody = @"Check out this image I just made"; [picker setMessageBody:emailBody isHTML:NO]; [self presentModalViewController:picker animated:YES]; [picker release]; </code></pre> <p>Any ideas?</p> <p>Also, the image I'm attaching is always portrait, even though I specify the orientation when I make it:</p> <pre><code>UIImage *image = [[UIImage alloc] initWithCGImage:imageRef scale:scale orientation:orientation]; </code></pre> <p>When I use the same technique to save images to the photo library the orientation is always set perfectly, just not when added as an email attachment.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload