Ios UITextContentTypeEmail对UITextField上的快速类型建议没有影响
当用户编辑电子邮件文本字段以及电子邮件确认文本字段时,我当前正在尝试显示用户电子邮件地址的快速类型建议。为此,我设定了两个条件: 文本字段的Ios UITextContentTypeEmail对UITextField上的快速类型建议没有影响,ios,objective-c,uitextfield,Ios,Objective C,Uitextfield,当用户编辑电子邮件文本字段以及电子邮件确认文本字段时,我当前正在尝试显示用户电子邮件地址的快速类型建议。为此,我设定了两个条件: 文本字段的textContentType及其autocorrectionType以显示快速类型栏 但是,设置textContentType似乎对快速类型栏的内容没有影响;它只显示编辑任何其他文本字段时显示的“单词”。这显然不是我希望我的用户看到的结果 以下是当前代码: SEL selector = NSSelectorFromString(@"textCont
textContentType
及其autocorrectionType
以显示快速类型栏
但是,设置textContentType
似乎对快速类型栏的内容没有影响;它只显示编辑任何其他文本字段时显示的“单词”。这显然不是我希望我的用户看到的结果
以下是当前代码:
SEL selector = NSSelectorFromString(@"textContentType");
// Make sure that the text field is actually able to process the event,
// the iOS version is greater than 10.3
if([self.emailTextField respondsToSelector: selector]){
self.emailTextField.textContentType = UITextContentTypeEmailAddress;
self.emailConfirmationTextField.textContentType = UITextContentTypeEmailAddress;
self.emailTextField.autocorrectionType = UITextAutocorrectionTypeDefault;
self.emailConfirmationTextField.autocorrectionType = UITextAutocorrectionTypeDefault;
}
据我所知,这只适用于从ios 11开始的第三方应用程序。据我所知,这只适用于从ios 11开始的第三方应用程序