MFMailComposeViewController 中没有任何内容可编辑且没有键盘
我正在启动一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,当我覆盖 viewDidAppear 时,我忘记调用 [super viewDidAppear]。
Turns out I had forgotten to call [super viewDidAppear] when I overrode viewDidAppear.