【问题标题】:MFMailComposeViewController cancel and send button not seen看不到 MFMailComposeViewController 取消和发送按钮
【发布时间】: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


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多