gpt4 book ai didi

ios - UITextField 的自动填充已损坏

转载 作者:行者123 更新时间:2023-11-28 05:40:07 26 4
gpt4 key购买 nike

在我应用程序的注册表单中,键盘建议输入我的名字、姓氏,最后输入一个强密码,但不建议输入我的电子邮件地址。我在 Storyboard和代码中将内容类型设置为电子邮件:

enter image description here

self.emailTxt.textContentType = .emailAddress

但没有建议。您可以在下图中看到,键盘建议用户的名字和姓氏,但对于电子邮件,它是空白的。 enter image description here

在下一张图片中,我展示了在 safari 上注册网站时,它确实会提示我的电子邮件。更重要的是,它建议自动填充整个页面:enter image description here

我可能遗漏了什么?

编辑:我创建了一个 github repo证明错误。每个字段都应该自动填充。我遇到的是,在此应用程序中,电子邮件有效,但密码不建议创建新密码。没有任何东西可以协同工作。

最佳答案

所以,一般来说,问题是 apple 的自动填充功能很难确定我是否在创建帐户。来自他们的 documentation here:

By default, the system selects the a keyboard based on the input view’s textContentType property; however, you can mix the input view’s text content type and keyboard type to explicitly define the desired keyboard. For example, if your site uses email addresses as user names, set the input view’s textContentType property to .username, and set the keyboardType property to .UIKeyboardType.emailAddress.

因此,对于电子邮件地址,我将内容类型设置为用户名,将键盘类型设置为电子邮件,一切都是固定的。

关于ios - UITextField 的自动填充已损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57101574/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com