Obscure a UITextField password

前端 未结 9 983
生来不讨喜
生来不讨喜 2020-12-07 15:20

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 s

相关标签:
9条回答
  • 2020-12-07 15:52
        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.

    0 讨论(0)
  • 2020-12-07 15:56

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

    0 讨论(0)
  • 2020-12-07 15:58

    One can do this for Obscure a UITextField password:

    enter image description here

    CODE

    Objective-C:

      textField.secureTextEntry = YES;
    

    Swift:

      textField.isSecureTextEntry = true 
    
    0 讨论(0)
提交回复
热议问题