出現(xiàn)原因前提是設(shè)置
textField.secureTextEntry = YES;
加入以下代碼解決問題
if (@available(iOS 11.0, *)) {
_tfPwd.textContentType = UITextContentTypePassword;
_tfRePwd.textContentType = UITextContentTypePassword;
}
if (@available(iOS 12.0, *)) {
_tfPwd.textContentType = UITextContentTypeNewPassword;
_tfRePwd.textContentType = UITextContentTypeNewPassword;
} else {
// Fallback on earlier versions
}
最后: *了*了,找了那么久