我已经创建了带有电子邮件、密码和确认密码字段的RegisterViewController
。
在电子邮件字段中,它始终在QuickType键盘栏上显示建议电子邮件,但其他字段不显示任何内容。
它如何知道哪个字段是电子邮件?我发誓我没有给textfield设置任何东西。我已经在我的基类文本字段上设置了autocorrectionType = .no
,但它仍然在栏上显示建议。
有人能帮我解决这个问题吗?
发布于 2021-07-07 14:17:54
这是你可以尝试的-
textField.autocapitalizationType = .none
textField.autocorrectionType = .no
textField.spellCheckingType = .no
发布于 2021-07-07 13:59:33
试试textField.textContentType = .none
发布于 2021-07-07 14:01:04
这不是自动更正。这是一个建议
使用以下代码禁用建议
if #available(iOS 12, *) {
// iOS 12 & 13: Not the best solution, but it works.
passwordTextField.textContentType = .oneTimeCode
} else {
// iOS 11: Disables the autofill accessory view.
// For more information see the explanation below.
emailTextField.textContentType = .init(rawValue: "")
passwordTextField.textContentType = .init(rawValue: "")
}
https://stackoverflow.com/questions/68287217
复制相似问题