在具有安全文本输入的 UITextField 上忽略 UIKeyboardTypeNumbersAndPunctuation
我有一个代表数字密码的 UITextField。我需要同时将键盘类型设置为 UIKeyboardTypeNumbersAndPunctuation 和 secureTextEntry。
如果我将 secureTextEntry 设置为“是”,则即使我已将 UIKeyboardTypeNumbersAndPunctuation 设置为 textField 键盘类型,textField 也会显示默认键盘。
另一方面,如果我将键盘类型设置为 UIKeyboardTypeNumberPad 它工作正常,但我没有完成/返回键来关闭该键盘。 =S
有解决方案或解决方法吗?
谢谢!
I've got a UITextField that represents a numeric password. I need to set the keyboard type to UIKeyboardTypeNumbersAndPunctuation and secureTextEntry at the same time.
If I set to Yes the secureTextEntry, the textField displays a Default Keyboard even if I had set UIKeyboardTypeNumbersAndPunctuation to the textField keyboard type.
By the other hand, if I set the keyboard type to UIKeyboardTypeNumberPad it works fine, but I have no done/return key to dismiss that keyboard. =S
is there a solution or a workaround for this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道这是不是一个错误...
我将代码从
XXX.KeyboardType = UIKeyboardTypeNumbersAndPunctuation
XXX.secureTextEntry = YES
更改为
XXX.secureTextEntry = YES
XXX.KeyboardType = UIKeyboardTypeNumbersAndPunctuation
然后,它起作用了...
I don't know it is a bug or not...
I changed the code from
XXX.KeyboardType = UIKeyboardTypeNumbersAndPunctuation
XXX.secureTextEntry = YES
to
XXX.secureTextEntry = YES
XXX.KeyboardType = UIKeyboardTypeNumbersAndPunctuation
Then, it works...