一些UITextfields在iOs6中没有响应 [英] Some UITextfields don't respond in iOs6

查看:101
本文介绍了一些UITextfields在iOs6中没有响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从更新到iOS 6后,我在尝试制作UITextField或UITextView firstResponder时遇到了这个最奇怪的错误。

Since updating to iOS 6 I have this weirdest bug when trying to make an UITextField or UITextView firstResponder.

...它不起作用。

我无法选择字段或视图并调出键盘,也没有光标或任何东西。
最奇怪的是,它只适用于某些字段,不同的视图控制器中的其他字段可以正常工作。

I am not able to select the field or view and bring up the keyboard, nor is there a cursor or anything. The weirdest thing is that it is only not working for SOME fields, other ones in different viewcontrollers work without trouble.

我有:

[self.window makeKeyAndVisible];
self.window.rootViewController = self.viewController;


它在iOS 5上工作并且仍然没有问题。

in my appDelegate. It worked and still works without problems with iOS 5.

关于它可能是什么的任何想法?

Any ideas on what it could be?

谢谢!

推荐答案

我发现了导致问题的原因。
从viewcontroller我提出的文本域中的新viewcontroller是firstResponder。所以当我通过调用

I found out what was causing the problem. From the viewcontroller I present the new viewcontroller from a textfield was firstResponder. So when I cancel this by calling

[textview resignFirstResponder]; 

[self.view endEditing:YES];

在展示新的viewcontroller之前,它没有问题。
问题仍然存在......为什么会这样?有没有更好的方法来克服这个问题?我在整个应用程序中辞去每个文本字段的感觉并不多...

BEFORE presenting the new viewcontroller, it works without problems. Question remains.... Why is this? And is there a better way to overcome this? I don't feel much for resigning every textfield throughout my app...

这篇关于一些UITextfields在iOs6中没有响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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