【问题标题】:Nothing is editable and no keyboard in MFMailComposeViewControllerMFMailComposeViewController 中没有任何内容是可编辑的,也没有键盘
【发布时间】:2010-04-14 02:41:17
【问题描述】:

我正在像这样启动一个 MFMailComposeViewController:

ShareViewController *shareView = [[ShareViewController alloc] initWithSubject:subject        body:body footer:footer];

shareView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
shareView.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:shareView animated:YES];    

初始化看起来是这样的:

- (id)initWithSubject:(NSString *)subject body:(NSString *)body footer:(NSString *)footer{

[super init];

self.navigationBar.barStyle = UIBarStyleBlack;
self.mailComposeDelegate = self;

[self setSubject:subject];    

body = [NSString stringWithFormat:@"%@ %@", body, footer];

[self setMessageBody:body isHTML:YES]; 

return self;
}

电子邮件窗口出现,我可以在电子邮件正文周围移动光标。但我根本无法调出键盘,或将光标移动到 To:、CC: 或 Subject: 字段。不知道发生了什么。这以前可以工作,但我最近做了一些 UI 更改。 “取消”按预期取消模式。未启用“发送”,因为“收件人:”字段中没有收件人。

有什么想法吗?

【问题讨论】:

  • ShareViewController 是 MFMailComposeViewController 的子类吗?如果是这样,我通常会远离它; compose 控制器是系统 UI 的黑盒部分,并非设计为子类化——尽管这可能会起作用,但我会先按原样使用 compose 控制器并在调用站点设置所有这些属性初始化之后。

标签: iphone mfmailcomposeviewcontroller


【解决方案1】:

原来我在覆盖 viewDidAppear 时忘记调用 [super viewDidAppear]。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    • 2020-11-17
    • 1970-01-01
    • 2012-06-11
    • 1970-01-01
    • 1970-01-01
    • 2020-12-19
    相关资源
    最近更新 更多