UITextView 不尊重 secureTextEntry 属性
我试图让 UITextView (不是 UITextField)充当密码字段,其中的文本在您输入时会被混淆。但是,在 UITextView 上将此属性设置为 YES 似乎没有任何效果,并且字母始终可见,而不是仅在输入的最后一个字母和点之外才可见。还有其他人遇到过这种情况并知道为什么会发生这种情况或者可能的解决方法是什么吗?如果有必要,我可以在我特别需要密码行为的情况下使用 UITextField,但这不会像仅使用 UITextView 那样干净。谢谢!
I'm trying to get a UITextView (NOT a UITextField) to act as a password field where the text is obfuscated as you type into it. However, setting this property to YES on a UITextView seems to have no effect and the letters are always visible instead of only being visible if it's the last letter typed and a dot otherwise. Has anyone else run into this and know why this happens or what a possible workaround may be? If necessary I can use a UITextField in the instances that I specifically need password behavior but that would not be as clean as just using UITextView only. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为特定的 UITextInputTraits 根本不适用于 UITextView。它适用于密码字段 (
UITextField
)。I think that specific UITextInputTraits simply does not work on the UITextView. It is intended for password fields (
UITextField
).