我正在做一个登录页面 . 我有UITextField密码 .
显然,我不希望看到密码;相反,我希望圈子在打字时显示 . 你如何设置这个领域的发生?
in Swift 3.0 or later
passwordTextField.isSecureTextEntry = true
只需选中故事板上的 Secure Text Entry 复选框即可
Secure Text Entry
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 .
请将您的UItextField属性设置为安全..
试试这个..
textFieldSecure.secureTextEntry = YES;
textFieldSecure是你的UITextField ...
可以为Obscure UITextField密码执行此操作:
CODE
Objective-C:
textField.secureTextEntry = YES;
Swift:
textField.isSecureTextEntry = true
在Interface Builder中设置Secure CheckBox属性
要么
在代码集中
yourTextField.secureTextEntry = YES;
yourTextField.secureTextEntry = true
将 secureTextEntry 属性设置为 YES .
secureTextEntry
YES
打开Xib文件并打开密码文本字段的检查器并勾选安全属性 .
For Swift 3.0:
txtpassword.isSecureTextEntry = true
9 回答
in Swift 3.0 or later
只需选中故事板上的
Secure Text Entry
复选框即可secureTextEntry设置为true .
请将您的UItextField属性设置为安全..
试试这个..
textFieldSecure是你的UITextField ...
可以为Obscure UITextField密码执行此操作:
CODE
Objective-C:
Swift:
在Interface Builder中设置Secure CheckBox属性
要么
在代码集中
Objective-C:
Swift:
将
secureTextEntry
属性设置为YES
.打开Xib文件并打开密码文本字段的检查器并勾选安全属性 .
For Swift 3.0: