MFMailComposeViewController不允许用户输入电子邮件

时间:2010-05-25 21:32:33

标签: iphone

我在下面配置了一个简单的MFMailComposeViewController。如果我填充setToRecipients,一切正常,电子邮件将被发送。如果我没有填充setToRecipients,则会弹出邮件编辑器窗口,但所有字段都不可编辑。

我认为MFMailComposeViewController允许用户在发送之前编辑电子邮件?这是否可以使用标准控件?

- (IBAction) sendEmail
{
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:[NSString stringWithFormat:@"Receipt Email - %@",[self.labelDate text]]];

    NSString *emailBody = @"This is the message body";

    [picker setMessageBody:emailBody isHTML:NO];

    [self presentModalViewController:picker animated:YES];
    [picker release];   
}

1 个答案:

答案 0 :(得分:0)

别介意......我没有辞去父视图的第一响应者>。<通过添加[self.parentViewController resignFirstResponder]解决; [self becomeFirstResponder];