MailComposeViewController在图像附件上强

MailComposeViewController在图像附件上强

本文介绍了MFMailComposeViewController在图像附件上强制实际大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,允许用户使用MFMailComposeViewController通过电子邮件发送图像。附加的图像是1200 x 1800,并且图像大小必须不变。

I'm working on an app that allows a user to email an image using MFMailComposeViewController. The attached image is 1200 x 1800 and it is imperative that the image size not change.

对于大图片,MFMailComposeViewController向用户提供一个操作表,让他们可以在按下发送时缩小图片大小(见截图)。我希望此操作表不显示,并强制附加图片的实际大小。

With large images, MFMailComposeViewController presents the user with an action sheet giving them the option to scale the image down when 'Send' is pressed (see screenshot). I'd prefer this action sheet not be displayed and to force the actual size of the image attached.

任何建议赞赏!

推荐答案

MFMailComposeViewController是一个类,我们不应该改变它的行为,根据苹果的准则。所以,更好地坚持默认行为,以免在提交应用程序审查时遇到问题。然而,有一个黑客你可以做:当用户选择任何其他选项,而不是你想要的,显示一个消息说,实际大小是什么将被附加,因为这是应用程序的行为,他/她的选择将已忽略。

MFMailComposeViewController is a class whose behavior we are not supposed to alter, according to Apple's guidelines. So, better stick to the default behavior so as not to run into problems when you submit the App for review. However, there is a hack you can do : when a user selects any other option, other than what you want, show a message saying that the actual size is what will be attached as that's the App's behavior and that his/her choice will be ignored.

这篇关于MFMailComposeViewController在图像附件上强制实际大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 00:25