【问题标题】:Expo - Disable Autofill Strong Password (autofill) on iOS 12Expo - 在 iOS 12 上禁用自动填充强密码(自动填充)
【发布时间】:2019-04-05 11:04:30
【问题描述】:

在我的 Expo 应用程序中,我想禁用此功能(强密码 ios 12):https://developer.apple.com/videos/play/wwdc2018/204/

简而言之,我想避免this(这不是我的应用程序)

我尝试了不同的方式,比如将这些属性添加到我的 textInput textContentType='none' autoCorrect={false}

没有任何效果...

有什么猜测吗?

【问题讨论】:

    标签: ios react-native passwords expo


    【解决方案1】:

    isSecureTextEntry 设置为假

    然后在您的应用委托文件中添加:

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
        if (textField == self.passwordTextField && !self.passwordTextField.secureTextEntry) {
            self.passwordTextField.secureTextEntry = YES;
        }
    
        return YES;
    }
    

    您可能需要退出您的应用才能在 xcode 中打开代码。

    【讨论】:

      【解决方案2】:

      找到了解决这个问题的唯一方法。

      textField.textContentType = .oneTimeCode

      否则 iOS 12 对任何安全字段使用 PasswordAutofill (textField.isSecureTextEntry = true)。

      【讨论】:

      • 这对我不起作用。我仍然在 iOS 12 上收到强密码建议。
      猜你喜欢
      • 1970-01-01
      • 2021-09-07
      • 2019-03-02
      • 1970-01-01
      • 2019-03-21
      • 2019-04-11
      • 2019-01-27
      • 1970-01-01
      • 2023-03-03
      相关资源
      最近更新 更多