问题
Has anyone been successful showing the standard Apple MFMailComposeViewController
from a UIModalPresentationStyleFormSheet
view controller on the iPad?
When I do this the view shows as expected but when the user taps any of the input text views, the subject for example, and the keyboard slides pressing the Cancel button will show the "Delete Draft" & "Save Draft" popover outside of the screen bounds.
If I change the modal view to full screen it works properly.
回答1:
I don't think you are presenting it as a Form Sheet then. Using this code works wonders for me:
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setSubject:@"Subject"];
[mailViewController setMessageBody:@"" isHTML:NO];
mailViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:mailViewController animated:YES];
来源:https://stackoverflow.com/questions/10218348/present-mfmailcomposeviewcontroller-from-modal-formsheet-on-ipad