MFMailComposeViewController 中没有任何内容可编辑且没有键盘

发布于 2024-08-29 04:03:16 字数 941 浏览 12 评论 0原文

我正在启动一个 MFMailComposeViewController,如下所示:

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

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

init 看起来如下:

- (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;
}

出现电子邮件窗口,我可以在电子邮件正文周围移动光标。但我根本无法打开键盘,或将光标移动到“收件人:”、“抄送:”或“主题:”字段。不知道发生了什么事。这以前是有效的,但我最近对 ​​UI 进行了一些更改。 “取消”按预期关闭模式。由于“收件人:”字段中没有收件人,因此未启用“发送”。

有什么想法吗?

I'm launching a MFMailComposeViewController like so:

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

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

The init looks this:

- (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;
}

The email window appears, and I can move the cursor around the body of the email. But I am not able to bring up a keyboard, or move the cursor to the To:, CC:, or Subject: fields at all. No idea what's going on. This was previously working but I've recently made several UI changes. 'Cancel' dismisses the modal as expected. 'Send' is not enabled since there's no recipient in the To: field.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请叫√我孤独 2024-09-05 04:03:16

事实证明,当我覆盖 viewDidAppear 时,我忘记调用 [super viewDidAppear]。

Turns out I had forgotten to call [super viewDidAppear] when I overrode viewDidAppear.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文