如何仅使用一次性代码自动填充支持从用户中禁用输入文字
我想禁用从一次性代码文本字段手动输入文本,而用户只能从键盘快速输入栏点击 SMS OTP 代码。
我从 Whatsapp 中得到的另一个问题是,他们的输入会自动显示键盘 Quicktype 栏,而我的则不会,除非我调用 becomeFirstResponder
我怎样才能实现这一点?
谢谢。
I want to disable manual text entering from one-time-code textField while the user only can tap SMS OTP Code from Keyboard Quicktype Bar.
Another question i got from seeing whatsapp is that their input shows the Keyboard Quicktype bar automatically while mine is not unless i call becomeFirstResponder
How can i achieve this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试此操作,也许它适用于您的用例
删除
textfield.iseNabled = false
如果在添加
textfield.delegate = self
之前添加了它,以便我们可以管理时用户添加输入添加
textfield.becomefirstresponder()
以使键盘出现,然后实现此uitextfielddelegate回调
检查是否为您提供所需的结果
You can try this, maybe it works for your use case
Remove
textField.isEnabled = false
if you added it beforeAdd
textField.delegate = self
so we can manage what happens when user adds inputAdd
textField.becomeFirstResponder()
to make the keyboard appearThen implement this UITextFieldDelegate callback
Check if this gives you the desired result