关闭 MFMailComposeViewController 后,自定义模态视图控制器看起来很奇怪

Custom modal view controller looks odd after dismissing MFMailComposeViewController

这是我使用过的代码,但是当我从邮件撰写控制器 return 时,我以前的模态视图控制器的大小变小了。我无法找到设置控制器大小的位置,因此它会影响呈现视图控制器。

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{

switch (result)
{
    case MFMailComposeResultCancelled:
        NSLog(@"Mail cancelled: you cancelled the operation and no email message was queued.");
        break;
    case MFMailComposeResultSaved:
        NSLog(@"Mail saved: you saved the email message in the drafts folder.");
        break;
    case MFMailComposeResultSent:
        NSLog(@"Mail send: the email message is queued in the outbox. It is ready to send.");
        break;
    case MFMailComposeResultFailed:
        NSLog(@"Mail failed: the email message was not saved or queued, possibly due to an error.");
        break;
    default:
        NSLog(@"Mail not sent.");
        break;
}

// Remove the mail view

[self dismissViewControllerAnimated:YES completion:nil];
self.view.frame = CGRectMake(0, 0, self.view.frame.size.width - 30, self.view.frame.size.height/2);

}

这只是一个愚蠢的错误。现在我想结束这个问题,这就是为什么我在这么长时间后发布答案。

self.view.frame = CGRectMake(0, 0, self.view.frame.size.width - 30, self.view.frame.size.height/2);

我只需要修复这条线,因为每次它都会减小它的宽度和大小。这是我在 iOS 的开始 ;)