Note that there are some explanatory texts on larger screens.

plurals
  1. POMFMailComposeViewController image orientation
    primarykey
    data
    text
    <p>I'm developing a Universal app and I'm coding for iOS6.</p> <p>I'm using the imagePickerController to take a photo and then I am sending it as an attachment using MFMailComposeViewController. All of that is working.</p> <p>My problem is that when I shoot a picture in portrait mode, it is displayed by the MFMailComposeViewController in landscape mode. Also, when it arrives at the destination E-Mail address, it is displayed in landscape mode.</p> <p>If I shoot the picture in landscape mode, it is displayed by the MFMailComposeViewController in landscape mode and when it arrives at the destination E-Mail address, it is displayed in landscape mode. So that's all OK.</p> <p>I have the same issue on both of my test devices; an iPhone5 and an iPad2.</p> <p>How can I make a picture shot in portrait mode arrive at the E-Mail destination in portrait mode?</p> <p>Here's how I am adding the image to the E-Mail:</p> <pre><code>if ( [MFMailComposeViewController canSendMail] ) { MFMailComposeViewController * mailVC = [MFMailComposeViewController new]; NSArray * aAddr = [NSArray arrayWithObjects: gAddr, nil]; NSData * imageAsNSData = UIImagePNGRepresentation( gImag ); [mailVC setMailComposeDelegate: self]; [mailVC setToRecipients: aAddr]; [mailVC setSubject: gSubj]; [mailVC addAttachmentData: imageAsNSData mimeType: @"image/png" fileName: @"myPhoto.png"]; [mailVC setMessageBody: @"Blah blah" isHTML: NO]; [self presentViewController: mailVC animated: YES completion: nil]; } else { NSLog( @"Device is unable to send email in its current state." ); } </code></pre>
    singulars
    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.
 

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