【发布时间】:2018-01-07 14:33:22
【问题描述】:
我曾尝试使用 MFMailComposeViewController,但是当视图出现时,看不到取消和发送按钮。 VC 为白色。我还尝试更改导航栏的一些色调,但没有任何效果。 设备使用 iPhone 8
任何正确方向的帮助都会有所帮助
下面是相同的代码。
MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init];
mailVC.mailComposeDelegate = self;
[mailVC setSubject:@"Looko App!"];
[mailVC setMessageBody:@"Found and sent using Demo App!" isHTML:NO];
[mailVC setToRecipients:@[@"myTestEmail@myEmail.com"]];
[self presentViewController:mailVC animated:YES completion:nil];
委托回调如下
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
switch (result) {
case MFMailComposeResultSent:
NSLog(@"Email sent");
break;
case MFMailComposeResultSaved:
NSLog(@"Email saved");
break;
case MFMailComposeResultCancelled:
NSLog(@"Email cancelled");
break;
case MFMailComposeResultFailed:
NSLog(@"Email failed");
break;
default:
NSLog(@"Error occured during email creation");
break;
}
[self dismissViewControllerAnimated:YES completion:NULL];
}
【问题讨论】:
标签: ios objective-c mfmailcomposeviewcontroller