MFMailComposeViewController 的"发送"和"取消"按钮未显示


由于

某种原因,发送和取消按钮没有出现,我什至在应用程序启动时在应用程序委托的应用程序开始时粘贴了以下代码,但仍然无法正常工作。任何人都可以帮忙,谢谢

mailController = [[MFMailComposeViewController alloc] init];
        mailController.mailComposeDelegate = self;
        [mailController setToRecipients:[strToEmailAddresses componentsSeparatedByString:@","]];
        [mailController setSubject:@"An Invite from MyGuide"];
        [mailController setMessageBody:@"Join me and your other friends now for free." isHTML:NO];
        if(mailController == nil)
            NSLog(@"Nil");
        else
            [self presentModalViewController:mailController animated:YES];

我自己偶然发现了这个问题,对我来说,答案是按钮具有白色色调(因为我的应用程序具有白色作为 tintColor),这使得它们在导航栏背景中不可见!所以他们实际上在那里,但颜色使它们看不见。如果这也是您的问题,则需要在将 MailComposer 推送到堆栈时将导航栏的色调临时设置为其他颜色。

确保 navgationBarHieedn 为 NO,这是 MFMailComposeViewController 的 navigationController 的属性。

我在"UINavigationController"类别中遇到了这个问题,该类别在推送新的视图控制器时将导航栏隐藏设置为YES。

最新更新