iOS 5问题:拔出UITextView时键盘消失 [英] iOS 5 issues: Disappearing keyboard when pulling up a UITextView

查看:114
本文介绍了iOS 5问题:拔出UITextView时键盘消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序商店中有一个不错的小应用程序,它本身也很好用。在iOS 5来到城镇之前,生活很棒。现在,我的应用程序有很多问题,我无法修复,因为我不知道发生了什么,因为我觉得它们是iOS 5问题,而不是我的问题。

I have a nice little app on the app store that does pretty well for itself. Life was great until iOS 5 came to town. Now, I have a number of issues with my app that I have no way of fixing because I have no clue what is going on, because I feel that they are iOS 5 issues, not mine.

我错过了iOS 5转换手册吗?或者他们只是为了好玩而改变一切,并希望我们找出所有复活节彩蛋的位置?

Was there an iOS 5 conversion manual I missed? Or did they just change everything for fun, and want us to figure out where all the easter eggs were?

这是我遇到的一个问题(我已经浪费了很多时间试图修复),当我只是说我想要在良好的情况下运行应用程序时,并不存在... 4.2:

Here is an issue I am experiencing (that I have wasted so much time trying to fix), that DON'T EXIST AT ALL when I simply say that I want to run the app in good ol' 4.2:

消失键盘

因此,当我拉出一个简单的模态视图时,我选择一个tableView单元格,然后我呈现一个textView,以便用户可以输入一些文本。当textView变得可见时,我调用[textView becomeFirstResponder];以便键盘启动并准备好供用户使用。这是第一次工作。然后,当你解散modalView(并得到我刚才提到的奇怪错误),然后尝试回到modalView,然后拉起textView,键盘飞走了!你看到它只有一秒钟,然后POOF就消失了。我有一个textView,我的光标处于活动状态,我正在尝试编辑,但我的键盘拒绝显示。再次,这在4.2中完美地运行,但不是在5中!

So when I pull up a simple modal view, I select a tableView cell, and then I present a textView so that users can enter some text. When the textView becomes visible, I call [textView becomesFirstResponder]; so that the keyboard is up and ready for the user to use. This works the first time. Then, when you dismiss the modalView (and get the weird error I just mentioned above), and then try and go back into the modalView, and pull up the textView, the keyboard flies away! You see it for a fraction of a second, and then POOF it's gone. I have a textView upon which my cursor is active and I am trying to edit, but my keyboard refuses to show up. Again, this works perfectly in 4.2, but not in 5!

我已经尝试了一切在阳光下解决这些问题,但我无法得到它们加工。我该怎么办?我觉得这些都是操作系统方面的错误,而不是我的错误!

I have tried everything under the sun to get these issues worked out, but I just can't get them working. What should I do? I feel that these are bugs on the OS side, not mine!

感谢您的帮助。

编辑:

为了更清楚,我将回顾我想要用我的视图层次结构完成的任务。当我显示我的模态视图时,我有两个不同的单元格,我填充了一些文本。第二个单元格应该是可编辑的,所以当用户点击单元格时,我取消隐藏我隐藏在viewDidLoad上的UITextView,并调用[textView becomeFirstResponder];在textView上,它工作正常。 textView是可编辑的,当键盘被解除时它隐藏并更新相应的单元格内容。

To be more clear, I will go over what I am trying to accomplish with my view hierarchy. When I display my modal view, I have two different cells that I fill up with some text. The second cell is supposed to be editable, so when the user taps the cell, I unhide a UITextView that I hid on viewDidLoad, and call [textView becomeFirstResponder]; on the textView, and it works fine. The textView is editable, and it hides and updates the appropriate cell content when the keyboard is dismissed.

问题是当我关闭模态视图时,然后回到在模态视图中,选择可编辑的单元格,textView显示得很好,并且它是可编辑的,但是键盘在屏幕上闪烁,但随后飞走了,不会显示。所以我在那里有我的textView并且可以编辑,但尽可能尝试,键盘不会显示!这绝对让我疯狂,特别是因为它在iOS 4.2上完美运行。

The problem is that when I dismiss the modal view, then came back into the modal view, and select the editable cell, the textView shows up just fine, and it is editable, but the keyboard blips onto the screen but then flys away and won't show. So I have my textView there and editable, but try as I might, the keyboard won't show! It's absolutely driving me nuts, especially because it works perfectly on iOS 4.2.

推荐答案

好的,我只能弄清楚是什么火焰正在进行中。我将 shouldAutorotateToInterfaceOrientation 值设置为可以从TURE或FALSE更改的 BOOL 变量,以便在<$时c $ c> modalView 回来了,有可能它不知道状态栏的状态/大小。通过手动将其设置为TRUE,它解决了问题,问题就消失了。

Ok, I was just able to figure out what in the blazes was going on. I had the shouldAutorotateToInterfaceOrientation value set to a BOOL variable that could change from TURE or FALSE, so that when the modalView was coming back, there was a chance that it didn't know the state/size of the status bar. By manually setting it to TRUE, it fixed the issue, and the problem disappeared.

这篇关于iOS 5问题:拔出UITextView时键盘消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆