gpt4 book ai didi

ios - MFMailComposeViewController 取消和发送按钮未见

转载 作者:行者123 更新时间:2023-11-29 00:05:38 25 4
gpt4 key购买 nike

我曾尝试使用 MFMailComposeViewController,但是当显示 View 时,看不到取消和发送按钮。 VC 为白色。我还尝试更改 navigationBar 的一些色调,但没有任何效果。 设备使用 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];

委托(delegate)回调如下

- (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];
}

最佳答案

在启动 MFMailComposeViewController 之前尝试设置导航栏外观:

[UINavigationBar appearance].tintColor = [UIColor yourColor];
MFMailComposeViewController *mailVC = [[MFMailComposeViewController alloc] init];
//...

关于ios - MFMailComposeViewController 取消和发送按钮未见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48138169/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com