在过去的两天里,我只是试图在我的应用程序中启用电子邮件发送功能。希望这里的聪明人之一可以帮助我。presentModalViewController 对我不起作用(只是让应用程序崩溃而没有解释原因),所以我不得不添加 MFMailComposeViewController 的视图。这是我的尝试:
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"test subject"];
[controller setMessageBody:@"this is the message body" isHTML:NO];
// [self presentModalViewController:controller animated:YES]; //this crashes the app
//so I try this instead:
controller.view.frame = CGRectMake(0,0,480,320);
[self.view addSubview:controller.view];
[controller release];
添加到屏幕上的只是主题栏,带有取消和发送按钮。不显示任何文本字段(收件人:、抄送:、主题、正文)。为什么它们不是 MFMailComposeViewController 视图的一部分,我该如何显示它们?