将PasswordField设置为secureTextEntry给我一个奇怪的行为 [英] Set a PasswordField to secureTextEntry give me a strange behaviour

查看:392
本文介绍了将PasswordField设置为secureTextEntry给我一个奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个passwordField,我将isSecureTextEntry设置为true,用于隐藏字符.但是,当我单击此passwordField时,将向我显示此错误:

I have a passwordField who i set the isSecureTextEntry to true, for hidden the characters. But when I click to this passwordField this show me this error :

[AutoFill] Cannot show Automatic Strong Passwords for app bundleID: "myapp" due to error: iCloud Keychain is disabled

键盘自动将密码传递给qwerty ...

and the keyboard automaticaly pass to an azerty to a qwerty...

如果我删除了passwordField.isSecureTextEntry = true,问题就消失了,但角色没有被隐藏...

If I remove the passwordField.isSecureTextEntry = true the problem disappear but the character are not hidden...

我向您展示我的代码:

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

我测试了此答案,但没有任何变化.

I test this answer but nothing change.

如何在没有iCloud钥匙串且没有将键盘更改为qwerty的情况下隐藏textField的字符?

How can I hidden the character of my textField without iCloud Keychain and without change keyboard to qwerty?

我看了其他所有主题,但与我的问题相比没有什么...

I looked every other subject but nothing compared to my problem...

推荐答案

当系统的用户未启用iCloud钥匙串时,就会发生这种情况.就像在模拟器上一样:)

This happens when the system's user doesn't have iCloud Keychain enabled. As will often be the case on the Simulator :)

我在模拟器上遇到了这个,然后来到了这里.在我的手机上(在启用了iCloud钥匙串 的手机上)进行了尝试,并得到了它:

I ran into this on the simulator and came here. Tried it on my phone (where iCloud Keychain is enabled), and got this instead:

[自动填充]无法显示应用程序包ID的自动强密码: 由于错误your.bundle.id:无法保存此应用的密码.制作 确保已为您的应用程序和自动填充设置了关联域 在设置"中启用了密码

[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的出色自动填充功能.在此处所述的一些步骤应该可以启用该功能.

So this is Apple's cool AutoFill feature. There are some steps described here that should enable that.

这篇关于将PasswordField设置为secureTextEntry给我一个奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆