UITextView 不尊重 secureTextEntry 属性

发布于 2024-08-19 11:33:16 字数 252 浏览 2 评论 0原文

我试图让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷鸟归林 2024-08-26 11:33:17

我认为特定的 UITextInputTraits 根本不适用于 UITextView。它适用于密码字段 (UITextField)。

I think that specific UITextInputTraits simply does not work on the UITextView. It is intended for password fields (UITextField).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文