简体   繁体   English

iOS 7:MFMailComposeViewController的两个问题

[英]IOS 7: Two issues with MFMailComposeViewController

I used the MFMailComposeViewController a lot in the past but for some reason now there is a very strange behaviour...that creates lots of problem in the usability of the interface.... 我过去经常使用MFMailComposeViewController ,但是由于某种原因,现在有一个非常奇怪的行为……这在接口的可用性方面造成了很多问题。

Issue #1: fields are not editable or the focus seems wrongly positioned. 问题1:字段不可编辑,或者焦点位置错误。

I create an email to be sent with an attachment (text or pdf) and each time the controller starts the "cc/bcc/from" fields overlap and are not editable. 我创建了一封带有附件(文本或pdf)发送的电子邮件,并且每次控制器启动“ cc / bcc / from”字段时,它们都会重叠并且不可编辑。 if i tap on the "to:" field sometimes the keyboards appears other times it doesn't ... The "to:"field is the only one editable (in blue) but clearly the focus is not right because sometimes i can edit the email address, other times, it becomes a completely blue box (no text is visible), etc.etc. 如果我点击“至:”字段,有时键盘会在其他时间不出现……“至:”字段是唯一一个可编辑的(蓝色),但焦点显然不正确,因为有时我可以编辑电子邮件地址,有时变成一个完全蓝色的框(看不到任何文本),依此类推。

At times the "cc:"field is expanded on a row but the tap position is not exactly right and no editing is possible. 有时,“ cc:”字段会连续扩展,但是分接位置并不完全正确,因此无法进行编辑。

Issue #2: the keyboards loads fast the first time, but if i close the composer and open it again, this time the keyboard takes at least 5 seconds to show up. 问题2:键盘第一次加载速度很快,但是如果我关闭作曲器然后再次打开它,则这次键盘至少需要5秒钟才能显示出来。

I tested the process on both iPad2 with IOS7 and in debug mode on Xcode 5.1 but the behaviour is always the same. 我在带有IOS7的iPad2和Xcode 5.1的调试模式下都测试了该过程,但是行为始终是相同的。
What i tried so far: 到目前为止我尝试过的是:

  1. set the mail composer as first responder, each time i open it: not working 每次我打开邮件作曲家时,将其设置为第一响应者:不起作用
  2. create temporary uitextfields to "pre-load" the keyboard: not working 创建临时uitextfields以“预加载”键盘:不起作用
  3. change the modal appearance from full screen to form sheets/pagesheet/etc: not working 将模式外观从全屏更改为表格/页面/等:不起作用

it seems to be memory related,at least the keyboard part, because at the beginning the App uses ~16 MBytes and the second time slightly higher (~26 Mbytes), but not big changes. 它似乎与内存有关,至少在键盘部分,这是因为在开始时该应用程序使用了〜16 MB,第二次该应用程序使用了更高的内存(〜26 MB),但变化不大。

The process flow for both issues: 这两个问题的流程:

  • You tap a send button, the mail composer opens, tap in the body and the keyboard appears.(still the email fields overlaps and not editable). 您点击发送按钮,邮件编辑器打开,在正文中点击,然后出现键盘。(电子邮件字段仍然重叠且不可编辑)。
  • You close it, you click again the send button, you do exactly the same moves but this time the keyboard does not show up , the "cc:/bcc:" fields are indented wrongly (on the left), nothing can be edited. 关闭它,再次单击发送按钮,您做的动作完全相同,但是这次键盘没有显示,“ cc:/ bcc:”字段的缩进错误(在左侧),无法进行任何编辑。

I have already gone through several answers/questions on this forum but nothing seems to work and this thing is really driving me mad...no more than 4 line of code (taken from Apple docs) and it does not work... 我已经在这个论坛上经历了几个答案/问题,但似乎没有任何效果,这件事确实让我发疯了……不超过4行代码(摘自Apple文档),它不起作用...

I had the same issue on ios6. 我在ios6上遇到了同样的问题。 (I've not tested this on ios7) Try these two methods before showing the MFMailComposeViewController, (我尚未在ios7上进行过测试)在显示MFMailComposeViewController之前,请尝试以下两种方法,

[self.parentViewController resignFirstResponder]; [self.parentViewController resignFirstResponder];

And this one on the mailComposer, 而这个在mailComposer上,

[self becomeFirstResponder]; [自己成为第一响应者];

Note - This answer is for your issue #1 注意-此答案适用于您的问题1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM