隐藏 UITextField 密码

发布于 2024-11-18 17:40:11 字数 91 浏览 0 评论 0原文

我正在做一个登录页面。我有 UITextField 作为密码。

显然,我不希望密码被看到;相反,我希望在打字时显示圆圈。 您如何设置实现这一目标的环境?

I am doing a login page. I have UITextField for password.

Obviously, I do not want the password to be seen; instead, I want circles to show when typing.
How do you set the field for this to happen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(9

娇女薄笑 2024-11-25 17:40:11

请将您的 UItextField 属性设置为安全..

试试这个..

textFieldSecure.secureTextEntry = true

textFieldSecure 是您的 UITextField...

对于较新的 Swift 版本,它是 textFieldSecure.isSecureTextEntry = true

Please set your UItextField property secure..

Try this..

textFieldSecure.secureTextEntry = true

textFieldSecure is your UITextField...

For newer Swift version, it is textFieldSecure.isSecureTextEntry = true

月依秋水 2024-11-25 17:40:11

可以这样做来隐藏 UITextField 密码:

在此处输入图像描述

代码

目标-C:

textField.secureTextEntry = YES;

斯威夫特:

textField.isSecureTextEntry = true 

One can do this for Obscure a UITextField password:

enter image description here

CODE

Objective-C:

textField.secureTextEntry = YES;

Swift:

textField.isSecureTextEntry = true 
安人多梦 2024-11-25 17:40:11

在 Interface Builder 中选中“安全文本输入”复选框

在代码集中:

Objective-C:

yourTextField.secureTextEntry = YES;

Swift:

yourTextField.secureTextEntry = true

In Interface Builder check the "Secure Text Entry" checkbox

or

In code set:

Objective-C:

yourTextField.secureTextEntry = YES;

Swift:

yourTextField.secureTextEntry = true
讽刺将军 2024-11-25 17:40:11

secureTextEntry 属性设置为 YES

Set the secureTextEntry property to YES.

策马西风 2024-11-25 17:40:11

打开Xib文件并打开密码文本字段的检查器并勾选安全属性。

Open the Xib file and open the inspector of the password text field and tick the secure property.

迷你仙 2024-11-25 17:40:11

对于 Swift 3.0:

txtpassword.isSecureTextEntry = true

For Swift 3.0:

txtpassword.isSecureTextEntry = true
浅笑依然 2024-11-25 17:40:11

Swift 3.0 或更高版本

passwordTextField.isSecureTextEntry = true

in Swift 3.0 or later

passwordTextField.isSecureTextEntry = true
逆光飞翔i 2024-11-25 17:40:11

只需选中情节提要上的安全文本输入复选框

在此处输入图像描述

Simply check Secure Text Entry check box on the storyboard

enter image description here

Smile简单爱 2024-11-25 17:40:11
txt_Password = new UITextField {
  Frame = new RectangleF (20,40,180,31),
  BorderStyle = UITextBorderStyle.Bezel,
  TextColor = UIColor.Black,
  SecureTextEntry = true,
  Font = UIFont.SystemFontOfSize (17f),
  Placeholder = "Enter Password",
  BackgroundColor = UIColor.White,
  AutocorrectionType = UITextAutocorrectionType.No,
  KeyboardType = UIKeyboardType.Default,
  ReturnKeyType = UIReturnKeyType.Done,
  ClearButtonMode = UITextFieldViewMode.WhileEditing,
};

secureTextEntry 设置为 true。

txt_Password = new UITextField {
  Frame = new RectangleF (20,40,180,31),
  BorderStyle = UITextBorderStyle.Bezel,
  TextColor = UIColor.Black,
  SecureTextEntry = true,
  Font = UIFont.SystemFontOfSize (17f),
  Placeholder = "Enter Password",
  BackgroundColor = UIColor.White,
  AutocorrectionType = UITextAutocorrectionType.No,
  KeyboardType = UIKeyboardType.Default,
  ReturnKeyType = UIReturnKeyType.Done,
  ClearButtonMode = UITextFieldViewMode.WhileEditing,
};

secureTextEntry set true.

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