首页 文章

隐藏UITextField密码

提问于
浏览
146

我正在做一个登录页面 . 我有UITextField密码 .

显然,我不希望看到密码;相反,我希望圈子在打字时显示 . 你如何设置这个领域的发生?

9 回答

  • 5

    in Swift 3.0 or later

    passwordTextField.isSecureTextEntry = true
    
  • 3

    只需选中故事板上的 Secure Text Entry 复选框即可

    enter image description here

  • 2
    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 .

  • 76

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

    试试这个..

    textFieldSecure.secureTextEntry = YES;
    

    textFieldSecure是你的UITextField ...

  • 9

    可以为Obscure UITextField密码执行此操作:

    enter image description here

    CODE

    Objective-C:

    textField.secureTextEntry = YES;
    

    Swift:

    textField.isSecureTextEntry = true
    
  • 35

    在Interface Builder中设置Secure CheckBox属性

    要么

    在代码集中

    Objective-C:

    yourTextField.secureTextEntry = YES;
    

    Swift:

    yourTextField.secureTextEntry = true
    
  • 1

    secureTextEntry 属性设置为 YES .

  • 7

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

  • 299

    For Swift 3.0:

    txtpassword.isSecureTextEntry = true
    

相关问题