出现MFMailComposeViewController
的键盘没有任何方法可以在键盘出现时将其解除。
有没有人知道改变键盘。当时您实际上在邮件客户端中没有公开UITextField
。
答案 0 :(得分:1)
邮件编辑器不是你自己修改的,它是一个系统提供的视图控制器,你明确告诉你不要在文档中修改:
重要提示:邮件撰写界面本身不可自定义,您的应用程序不得修改。此外,在显示界面后,您的应用程序不允许对电子邮件内容进行进一步更改。用户仍然可以使用界面编辑内容,但忽略程序化更改。因此,您必须在呈现界面之前设置内容字段的值。
取消按钮已经在左上方,“完成”会做什么?发送电子邮件?那是在右上角。
答案 1 :(得分:0)
MFMailComposeViewController没有“完成”按钮,因为它假设您将该按钮用作返回键(以换行)。
如果您真的想将按钮更改为“完成”按钮,我只能想到一种方法:
当您找到作为正文的UITextView时,请执行以下操作:
// Get the UITextView from subview inspection
UITextView *textView;
// Declare this instance variable in your class @interface
id <UITextViewDelegate> originalTextViewDelegate;
// Get the original delegate
originalTextViewDelegate = [textView delegate];
// Override the delegate
[textView setDelegate:self];
// Set the return key type
[textView setReturnKeyType:UIReturnKeyDone];
在-textViewShouldEndEditing上返回YES。实现所有UITextViewDelegate方法,并调用originalTextViewDelegate(类似于在子类上调用“super”)。
- (BOOL)textViewShouldEndEditing:(UITextView *)textView
{
[originalTextViewDelegate textViewShouldEndEditing:textView];
// Important: return YES, regardless of originalTextViewDelegate's response
return YES;
}
- (void)textViewDidChangeSelection:(UITextView *)textView
{
[originalTextViewDelegate textViewDidChangeSelection:textView];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
return [originalTextViewDelegate textView:textView shouldChangeTextInRange:range replacementText:text];
}
// etc
这应该有效,但不能保证。希望有所帮助! :d