本国的 UITextField 受保护的电力英语领域 /US/ 键盘

我有一个非常简单的登录页面 /登录 + 密码/.

我的法国用户,所以他们的键盘 - 法语 /azerty/.

以。。。开始 iOS 12, 当他们单击受保护的密码文本字段时,键盘交换为英语 /qwerty/, 即使它们没有安装在其设备上的键盘。 此外,如果它们没有此键盘,则无法切换回其键盘。

我发现如果我停用一个安全的文本输入,则不会出现问题。

我也试图安装 isSecureTextEntry 软件,错误已发现。

我添加两个屏幕截图,一个用于每个文本字段。

非常感谢您的参与。 & 帮助。

https://i.stack.imgur.com/DhguE.jpg
https://i.stack.imgur.com/RN00N.jpg
已邀请:

莫问

赞同来自:

我有同样的问题,在我的情况下,此错误仅显示在注册屏幕上。

原因是 Apple 检查名称 class/func/parameter, 确定 /在启发式的帮助下/, 这是一个输入屏幕/注册并自动激活自动填充密码。
代替 "register" 在 "Patate" 在我的代码中,问题将解决。

我将通过样本应用程序重现此问题 2 文本字段 /输入文本文本/ 并认为控制器命名 "RegisterViewController". 从 A "PatateViewController" 我没有这样的问题。

而且,我在控制台中有此错误 :
[AutoFill] 无法为应用程序显示自动可靠的密码 bundleID: *** 因为一个错误: iCloud 钥匙串被禁用了

来源:
https://developer.apple.com/do ... ofill
我希望你能找到比重命名你的代码的最佳方式。

奔跑吧少年

赞同来自:

我有同样的问题,最近在我们的申请中出现。
问题与新功能有关。

PasswordAutofill

经过 Apple.

要解决此问题,可以将此小型代码片段应用于受保护的文本字段。


if #available/iOS 12.0, */ {
tfPassword.textContentType = .oneTimeCode
}


这应该消除此错误。
它也应该解决此错误:

[AutoFill] 无法为应用程序显示自动可靠的密码 bundleID: *** 因为一个错误: iCloud 钥匙串被禁用了

Ps: 您还可以在应用程序中添加此新功能。
这是对解释实现这一新功能的过程的文章的引用。
https://medium.com/developerin ... a1810
我希望它会有所帮助。

江南孤鹜

赞同来自:

我有同样的问题,我通过安装来决定它

全部

我的财产 textFields
textContentType


UITextContentType.oneTimeCode

.

当然,
oneTimeCode

现在它是无用的,因为他到处都是......

窦买办

赞同来自:

现在相同的解决方案 Swiftui :


TextField/"placeholder",text: $YourTextBinding/
.textContentType/.oneTimeCode/
.keyboardType/.default/


只需要添加 :


.textContentType/.oneTimeCode/
.keyboardType/.default/


到A.
TextField

或者
SecureField

.

我希望这个能帮上忙 !

卫东

赞同来自:

我有同样的问题 React Native, 我安装时 keyboardType 在 "numeric-pad".
这是一个原生问题 IOS 由于文件中安装了默认语言
info.plist

.

我在这里找到了一个解决方案:
https://github.com/facebook/re ... 27972
删除这些 2 排行默认语言设置 :


<key>CFBundleDevelopmentRegion</key>
<string>en</string>


你也可以改变
<string>en</string>


<string>fr</string>

, 但是,您将对英语用户有同样的问题,他们将开关 AZERTY keyboard :/

窦买办

赞同来自:

iOS 12.1 对我纠正了这个问题。

您还必须设置参数
textContentType

密码文本字段
.oneTimeCode

莫问

赞同来自:

Swift 3

:

创建一个基本类 UITextField 从 languageCode 和 textInputMode.


class BaseTextField: UITextField {

// ru, en, ....
var languageCode: String? {

didSet{

if self.isFirstResponder{

self.resignFirstResponder//;
self.becomeFirstResponder//;
}
}
}

override var textInputMode: UITextInputMode? {

if let language_code = self.languageCode {

for keyboard in UITextInputMode.activeInputModes {

if let language = keyboard.primaryLanguage {

let locale = Locale.init/identifier: language/;
if locale.languageCode == language_code {

return keyboard;
}
}
}
}

return super.textInputMode;
}}


使用

:

设定值 /例如, En, .../, 到 languageCode. 它会改变 locale 在键盘上。


private func textConfigure/textField: UITextField/ {

textField.keyboardType = .default
textField.autocapitalizationType = .words
textField.languageCode = "ru"
}


我希望能帮到你。

二哥

赞同来自:

Lamers Lamera误差决定必须是,我的意思是蹩脚的工作公司 Apple.

我的决定是强迫关注密码字段,然后专注于第一个字段,在我的情况下 usernameField.


- /void/ viewDidAppear:/BOOL/animated {
[super viewDidAppear:animated];
[self.passwordTextField becomeFirstResponder];
[self.usernameTextField becomeFirstResponder];
}

奔跑吧少年

赞同来自:

这真的是一个错误 iOS => 固定B. iOS 12.1

詹大官人

赞同来自:

在我纠正它的情况下,只是将它添加到我的主要内容 viewController :


func passwordSignUpViewController/forAuthUI authUI: FUIAuth, email: String, requireDisplayName: Bool/ -> FUIPasswordSignUpViewController {
return CustomPasswordSignUpViewController/authUI: authUI, email: email, requireDisplayName: true/
}


我创造了一个子类 FUIPasswordSignUpViewController


import Foundation
import FirebaseUI

class CustomPasswordSignUpViewController : FUIPasswordSignUpViewController, UITextFieldDelegate {

override init/nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?, authUI: FUIAuth, email: String?, requireDisplayName: Bool/ {
super.init/nibName: "FUIPasswordSignUpViewController", bundle: nibBundleOrNil, authUI: authUI, email: email, requireDisplayName: requireDisplayName/
}

required init?/coder aDecoder: NSCoder/ {
super.init/coder: aDecoder/
}

override func viewDidLoad// {
super.viewDidLoad//
}

func textFieldDidBeginEditing/_ textField: UITextField/ {
if #available/iOS 12.0, */ {
textField.textContentType = .oneTimeCode
}
}
}

要回复问题请先登录注册