UITextField 不允许第三方键盘

UITextField doesn't allow 3rd party keyboard

我在 viewController 的主 view 中有一个 scrollView,其中包含两个 textFields、一个电子邮件和一个密码

如果我在密码字段上设置 isSecureEntry = true),电子邮件将无法使用第 3 方键盘(无关紧要 keyboardType我将其设置为)。这是正常行为吗?如果它在视图上检测到安全 textField,它会禁用所有 textFields 的第 3 方键盘?因为如果我在密码字段上设置 isSecureEntry = false,两个文本字段都可以使用第 3 方键盘。

UITextViews整个app都能正常使用,其他UITextFields其他视图也能正常使用。

如果这很重要,那么在弹出语言更改器弹出窗口时,这一堆系统限制就会被打破:

Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
(
    "<NSLayoutConstraint:0x1d02966c0 'UISV-canvas-connection' UIStackView:0x102c6d820.leading == UIInputSwitcherTableCellSegmentView:0x102c6df20.leading   (active)>",
    "<NSLayoutConstraint:0x1d0296760 'UISV-canvas-connection' H:[UIInputSwitcherTableCellSegmentView:0x102c6fc00]-(0)-|   (active, names: '|':UIStackView:0x102c6d820 )>",
    "<NSLayoutConstraint:0x1d0296800 'UISV-fill-equally' UIInputSwitcherTableCellSegmentView:0x102c6efd0.width == UIInputSwitcherTableCellSegmentView:0x102c6df20.width   (active)>",
    "<NSLayoutConstraint:0x1d02968f0 'UISV-fill-equally' UIInputSwitcherTableCellSegmentView:0x102c6fc00.width == UIInputSwitcherTableCellSegmentView:0x102c6df20.width   (active)>",
    "<NSLayoutConstraint:0x1d02967b0 'UISV-spacing' H:[UIInputSwitcherTableCellSegmentView:0x102c6df20]-(9)-[UIInputSwitcherTableCellSegmentView:0x102c6efd0]   (active)>",
    "<NSLayoutConstraint:0x1d02968a0 'UISV-spacing' H:[UIInputSwitcherTableCellSegmentView:0x102c6efd0]-(9)-[UIInputSwitcherTableCellSegmentView:0x102c6fc00]   (active)>",
    "<NSLayoutConstraint:0x1d0295860 'UIView-Encapsulated-Layout-Width' UIStackView:0x102c6d820.width == 0   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x1d02968a0 'UISV-spacing' H:[UIInputSwitcherTableCellSegmentView:0x102c6efd0]-(9)-[UIInputSwitcherTableCellSegmentView:0x102c6fc00]   (active)>

谢谢!

一旦您为文本域启用安全文本输入,系统将限制第三方键盘,它也会影响之前的文本域,即您的电子邮件文本域 situation.But 它只影响之前的一个文本域具有安全文本输入的文本字段 porperty.That 意思是,如果您在一个视图中有三个文本字段,则视图层次结构如下:

--滚动视图

-textfield1(可以使用第三方键盘)

-textfield2(不能使用第三方键盘)

-textfield3(安全文本输入)(不能使用第三方键盘)

你看,顶部文本字段不会受到安全文本输入属性的影响。 所以,我找到了一个针对你的情况的解决方案,你可以在电子邮件文本字段和密码 textfield.Now 之间插入一个高度很小(但不隐藏,例如 0.5)的文本字段,你可以在电子邮件中使用第三方键盘文本框。