我有一个 passwordField
,我将 isSecureTextEntry
设置为 true
以隐藏字符。但是当我点击这个passwordField
时,日志中出现如下错误:
[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: "myapp" due to error: iCloud Keychain is disabled
键盘自动从 azerty 变为 qwerty...
如果我删除 passwordField.isSecureTextEntry = true
,问题就会消失,但字符不会被隐藏...
这是我的代码:
passwordField.borderStyle = UITextField.BorderStyle.none
passwordField.font = UIFont(name: "Avenir-Heavy", size: 13)
passwordField.autocorrectionType = UITextAutocorrectionType.no
passwordField.clearButtonMode = UITextField.ViewMode.whileEditing
passwordField.keyboardType = UIKeyboardType.default
passwordField.returnKeyType = UIReturnKeyType.done
passwordField.contentVerticalAlignment = UIControl.ContentVerticalAlignment.bottom
passwordField.isSecureTextEntry = true
我测试了this answer但没有任何改变。
如何在没有 iCloud Keychain 且不将键盘更改为 qwerty 的情况下隐藏我的 textField 的字符?
我检查了其他答案,但没有什么与我的问题相似...
最佳答案
当系统用户没有启用 iCloud 钥匙串(keychain)时,就会发生这种情况。就像模拟器上经常出现的情况一样:)
我在模拟器上遇到了这个,然后来到这里。在我的手机上试了一下(启用了 iCloud 钥匙串(keychain) ),结果得到了这个:
[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: your.bundle.id due to error: Cannot save passwords for this app. Make sure you have set up Associated Domains for your app and AutoFill Passwords is enabled in Settings
这就是 Apple 很酷的自动填充功能。描述了一些步骤 here那应该可以做到这一点。
关于ios - 将 PasswordField 设置为 secureTextEntry 给我一个奇怪的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52770550/