如何自定义MFMailComposeViewController,以便我可以将“to”字段为不可编辑? [英] How to customize MFMailComposeViewController so that i can make the "to" field as non-editable?

查看:108
本文介绍了如何自定义MFMailComposeViewController,以便我可以将“to”字段为不可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MFMailComposeViewController在我的应用程序中发送反馈。工作正常但这里的问题是,用户可以编辑/删除到地址。我想把它作为一个不可编辑的。可能,用户可以在到字段中添加一些邮件地址。

I am using MFMailComposeViewController for sending feedback in my app. It works fine. But the problem here is, the user can edit/delete the "to" address. I want to make it as a non-editable one. May be, the user can add some mail addresses in "to" field.

但是,他/她不应删除反馈地址(这里是支持@ xxxx .COM)。

But he/she should not delete the feedback address (Here, it is "support@xxxx.com").

这是我的代码...

MFMailComposeViewController *composeWindow = [[MFMailComposeViewController alloc] init];
composeWindow.mailComposeDelegate = self;

NSString *str = @"Subject of the feedback";
[composeWindow setSubject:[str stringByAppendingString:[[UIDevice currentDevice]systemVersion]]];

NSArray *toRecipients = [NSArray arrayWithObject: @"support@xxxx.com"]; 
[composeWindow setToRecipients:toRecipients];

[self presentModalViewController:composeWindow animated:YES];
[composeWindow release];

感谢提前

Rajkanth


Rajkanth

推荐答案

您无法自定义 MFMailComposeViewController 以避免编辑。苹果禁止这一点,原因很简单:用户是不是必须确定要发送的内容,给谁等等。同样适用于允许发送短信(短信)的UI控制器。而且,当然,苹果不允许发送电子邮件或短信,而与用户没有明确的交互。用户必须验证并发送电子邮件或短信。验证过程包括取消消息或随意更改任何单个属性的能力,包括至收件人。

You can not customize MFMailComposeViewController to avoid editing. Apple forbids this, and the reason is quite simple: it is the user and not you that must decide exactly what to send, to whom etc. The same applies for the UI controller allowing to send SMS (text) messages. And, of course, Apple does not allows sending an email or SMS without explicit interaction with the user. It is the user that must validate and send the email or SMS message. The validation process include the ability to cancel the message or to change any single property at will, including the "to" recipients.

这篇关于如何自定义MFMailComposeViewController,以便我可以将“to”字段为不可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆