如何停止显示字符的 UITextField 安全文本 [英] How do I stop UITextField Secure text showing characters

查看:22
本文介绍了如何停止显示字符的 UITextField 安全文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的 UITextField 启用了安全文本.在运行时,当我输入一些文本时,我最初会在它变成项目符号之前看到该字符.有没有办法阻止它显示字符并在我输入时将其作为项目符号.

I've enabled Secure text for my UITextField. At runtime when I type some text in I initially see the character before it turns to a bullet point. Is there a way to stop it showing the characters and having it as a bullet point as I type.

有什么需要补充的吗

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

有人有例子吗?

推荐答案

这是 UITextField 的默认行为. 所以你无能为力.您可以在编码方面使用某种加密,但在视图方面,这种行为将占上风.

That is the default behaviour of the UITextField. So there's nothing much you can do about it. You can play with some kind of encryption on the coding side but on the view side, this behaviour will prevail.

这篇关于如何停止显示字符的 UITextField 安全文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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