【发布时间】:2015-07-02 07:56:18
【问题描述】:
这是我使用过的代码,但是当我从邮件撰写控制器返回时,我以前的模态视图控制器大小会减小。我无法找到设置控制器大小的位置,因此它会对呈现视图控制器产生影响。
- (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);
}
【问题讨论】:
-
尝试在 -(void)viewWillAppear 方法中设置大小
-
@Sushrita- 已经尝试过这个东西,但没有得到想要的输出。
-
你能详细说明问题是什么吗?
-
我有一个自定义框架大小的模态视图控制器。在特定屏幕上,我必须使用 MFMailViewController。直到现在一切正常,但是当我使用dismissViewControllerAnimated 方法来关闭邮件视图控制器时。我的屏幕尺寸变小了。我试图明确地改变它的大小,但力求成功。
-
您使用的是 .xib 还是 storyboard?
标签: ios objective-c viewcontroller modalviewcontroller