iOS 11禁用密码自动填充附件视图选项? [英] iOS 11 disable password autofill accessory view option?

查看:996
本文介绍了iOS 11禁用密码自动填充附件视图选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至目前,我想退出iOS 11提供的新选项,即在应用中建议密码。当我在iOS 11上运行应用程序时,我在键盘顶部获得了自动填充选项,我的用户名和密码文本字段甚至都没有出现。

As of now I would like to opt out of the new option iOS 11 gives, that is to suggest passwords in the app. When I run the app on iOS 11 I get the autofill option on top of the keyboard and my username and password textfield don't even show up.

所以,我的问题是,如何一起禁用新密码自动填充功能,以便键盘上的键完全不显示,整体行为与iOS 11之前的相同?

So, my question is, how can I disable the new password autofill feature all together so the key on the keyboard is not shown at all and the overall behavior is the same as pre iOS 11?

推荐答案

这对我有用:

        if #available(iOS 10, *) {
            // Disables the password autoFill accessory view.
            textField.textContentType = UITextContentType("")
    }

确保你像这样设置所有 UITextField 对象。例如,如果您有一个 UITextField 对象,其中用户必须输入他的电子邮件地址,另一个用户必须输入其密码,请指定 UITextContentType( )到他们的 textContentType 属性。否则它将无法工作,仍会显示自动填充附件视图。

Make sure you setup all of your UITextField objects like this. If you have for example an UITextField object where the user must enter his email address and another one where the user must enter his password assign UITextContentType("") to both of their textContentType property. Otherwise it will not work and the autoFill accessory view will still be shown.

这篇关于iOS 11禁用密码自动填充附件视图选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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