当我尝试输入一个字符时,安全文本输入会冻结 [英] Secure text entry freezes when I try to type one character

查看:23
本文介绍了当我尝试输入一个字符时,安全文本输入会冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个密码文本字段,如果我尝试输入单个字符,它会使应用程序崩溃.我已经参考了

I have a password text field which will crash the app if I try to type a single character. I have referenced

推荐答案

我刚刚发现,如果您使用 UITextField 的自定义类,在 Secure Text Entry 文本字段的该类中设置 self.textColor 可能是冻结的原因.我通过以下方式解决了:

I just found out, if you are using Custom Class for UITextField, setting self.textColor in that class on Secure Text Entry text field might be the cause of freezing. I solved it by doing:

if (!self.isSecureTextEntry) {
    self.textColor = UIColor.white
}

这篇关于当我尝试输入一个字符时,安全文本输入会冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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