UITextField 암호 숨기기
로그인 페이지를 하고 있습니다.패스워드에 UITextField가 있습니다.
물론 비밀번호는 표시하지 않고 동그라미를 쳐야 합니다.이러한 상황이 발생하려면 어떻게 해야 합니까?
UItextField 속성을 안전하게 설정하십시오.
이거 드셔보세요.
textFieldSecure.secureTextEntry = true
textFieldSecure는 UITextField...
새로운 Swift 버전에서는textFieldSecure.isSecureTextEntry = true
UITextField 암호의 경우 다음을 수행할 수 있습니다.
코드
목표-C:
textField.secureTextEntry = YES;
신속:
textField.isSecureTextEntry = true
Interface Builder에서 "Secure Text Entry" 확인란을 선택합니다.
또는
코드 세트:
목표-C:
yourTextField.secureTextEntry = YES;
신속:
yourTextField.secureTextEntry = true
설정secureTextEntry
의 재산.YES
.
Xib 파일을 열고 암호 텍스트 필드의 검사기를 열고 보안 속성을 선택합니다.
Swift 3.0의 경우:
txtpassword.isSecureTextEntry = true
Swift 3.0 이후
passwordTextField.isSecureTextEntry = true
간단히 확인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로 설정됩니다.
언급URL : https://stackoverflow.com/questions/6578824/obscure-a-uitextfield-password
'programing' 카테고리의 다른 글
PowerShell의 *Nix 'which' 명령어와 동등합니까? (0) | 2023.04.14 |
---|---|
여러 하위 프로세스가 완료될 때까지 bash에서 기다렸다가 하위 프로세스가 코드 !=0으로 끝날 때 종료 코드 !=0을 반환하는 방법? (0) | 2023.04.14 |
'git pull'과 'git fetch'의 차이점은 무엇입니까? (0) | 2023.04.09 |
WPF 코드 배후에 의한 리소스 액세스 (0) | 2023.04.09 |
Ruby에서 어레이의 일부를 반환하려면 어떻게 해야 합니까? (0) | 2023.04.09 |