Present MFMailComposeViewController from modal FormSheet on iPad?

蹲街弑〆低调 提交于 2020-02-03 09:45:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!