ios – 通过UIDocumentInteractionController与Mail交互

ios – 通过UIDocumentInteractionController与Mail交互,第1张

概述我正在通过UIDocumentInteractionController与其他应用共享PDF.在添加此功能之前,我使用MFMailComposeViewController定制了“发送到电子邮件”按钮 – 但现在我的UIDocumentInteractionController中还有一个Mail按钮,我想使用它来避免重复按钮. 我的问题是,通过旧的邮件控制器,我曾经设置主题和内容文本,而如果我使用 我正在通过UIdocumentInteractionController与其他应用共享pdf.在添加此功能之前,我使用MFMailComposeVIEwController定制了“发送到电子邮件”按钮 – 但现在我的UIdocumentInteractionController中还有一个Mail按钮,我想使用它来避免重复按钮.

我的问题是,通过旧的邮件控制器,我曾经设置主题和内容文本,而如果我使用UIdocumentInteractionController – 我只收到一封带有pdf附件的空白电子邮件.有没有人知道我可以解决这个问题,并在使用UIdocumentInteractionController时获取我的自定义主题和内容?

我在文档中找不到任何明显的东西,显然我不能干涉Mail应用程序以使其与我的应用程序通信 – 但是想知道是否有其他人遇到过这个问题,并且怀疑是“后门”解决方案.

下面是我目前正在创建和初始化我的UIdocumentInteractionController的代码:

-(voID)opendocumentIn:(Nsstring*)filepath{    //Nsstring * filePath = [[NSBundle mainBundle]                                   pathForResource:filePath ofType:@"pdf"];    documentController = [UIdocumentInteractionController                          interactionControllerWithURL:[NSURL fileURLWithPath:filepath]];    documentController.delegate = self;    documentController.UTI = @"com.adobe.pdf";    [documentController presentoptionsMenuFrombarbuttonItem:         [self.imageVIEwController exportQuote] animated:YES];}
解决方法 您可以通过以下代码执行此 *** 作
[self.documentInteractionController setname:@"My Email Subject"];
总结

以上是内存溢出为你收集整理的ios – 通过UIDocumentInteractionController与Mail交互全部内容,希望文章能够帮你解决ios – 通过UIDocumentInteractionController与Mail交互所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1099816.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存