ios - 无法在 UIAlertView 中使用键盘输入

标签 ios uialertview

最近我在 UIAlertView 中使用了 UITextFied 来提示用户输入密码。但是在呈现 UIAlertView 后,我发现键盘被某些层重叠/覆盖,我无法通过键盘输入任何内容。

你能告诉我如何解决这个问题吗?非常感谢。

![UIAlertView 的屏幕截图][1]

http://i.stack.imgur.com/CMvMz.png

最佳答案

请不要子类化或弄乱 UIAlertView 内的元素。 Apple's documentation says this:

Subclassing Notes

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

您需要创建自己的 UIView(带有文本字段和按钮),您可以将其作为 subview 添加到当前可见 View 中的任何其他内容之上。

关于ios - 无法在 UIAlertView 中使用键盘输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14288978/

相关文章:

javascript - 在JavaScript中检测苹果的强制幻像横幅

ios - 如何在 UIAlertView 中容纳 8 个按钮

ios - 在另一个自定义警报或 uialertview 上方显示自定义警报

ios - XMPP - 如何加入现有的 MUC 房间

ios - 在Swift中自动调整多行UILabel的大小

ios - 显示键盘时Swift ios移动文本字段

iphone - 如何实现loadView?

swift - 为什么它总是只显示第一个警报?

ios - ios-应该在NSUrlConnection的返回 block 中使用UIAlertView吗?

objective-c - UIAlertView 有 19 个按钮