iphone - 某些 UITextfields 在 iOs6 中没有响应

标签 iphone ios uitextfield ios6

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

...它不起作用。

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

我有:

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

在我的 appDelegate 中。 它在 iOS 5 上运行并且仍然运行没有问题。

有什么想法吗?

谢谢!

最佳答案

我找出了导致问题的原因。 从 viewcontroller 我提出了来自文本字段的新 viewcontroller 是 firstResponder。所以当我通过调用

取消它时
[textview resignFirstResponder]; 

[self.view endEditing:YES];

在展示新的 View Controller 之前,它可以正常工作。 问题仍然存在……这是为什么?有没有更好的方法来克服这个问题?我对在我的应用程序中放弃每个文本字段感觉不太好......

关于iphone - 某些 UITextfields 在 iOs6 中没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12585463/

相关文章:

swift - 带填充、顶部垂直对齐、多行占位符文本的自定义文本字段

iphone - 如何发送 UIEvent TypeRemoteControl 事件?

iphone - 调用存在于多个类中的方法的最佳方法

ios - Spritekit : Pausing parent node does not pause child node

ios - 如何在 Swift 中将滚动图像放在静止图像后面

ios - 强制方向改变有时不起作用

ios - 扩展不适合我 UITextField

iphone - iPhone 应用程序中的 super /子类和 View

iphone - 使用自定义 NSEntityMigrationPolicy 进行核心数据迁移 - 效率?

ios - 无法滚动包含 UITextFields 的 UITableViewCells