Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITextContentTypeEmail对UITextField上的快速类型建议没有影响_Ios_Objective C_Uitextfield - Fatal编程技术网

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开始的第三方应用程序