Tôi đang làm một trang đăng nhập. Tôi có UITextField cho mật khẩu.
Rõ ràng, tôi không muốn nhìn thấy mật khẩu; thay vào đó, tôi muốn các vòng tròn hiển thị khi gõ. Làm thế nào để bạn thiết lập trường cho điều này xảy ra?
Tôi đang làm một trang đăng nhập. Tôi có UITextField cho mật khẩu.
Rõ ràng, tôi không muốn nhìn thấy mật khẩu; thay vào đó, tôi muốn các vòng tròn hiển thị khi gõ. Làm thế nào để bạn thiết lập trường cho điều này xảy ra?
Câu trả lời:
Vui lòng đặt thuộc tính UItextField của bạn an toàn ..
Thử cái này..
textFieldSecure.secureTextEntry = true
textFieldSecure là UITextField của bạn ...
Người ta có thể làm điều này để che khuất mật khẩu UITextField:
MÃ
Mục tiêu-C:
textField.secureTextEntry = YES;
Nhanh:
textField.isSecureTextEntry = true
trong Swift 3.0 trở lên
passwordTextField.isSecureTextEntry = true
textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String)
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 đặt đúng.