gpt4 book ai didi

ios - 通过 UITextFields 约束问题交换

转载 作者:行者123 更新时间:2023-12-01 16:20:30 24 4
gpt4 key购买 nike

我有一个 EditProfileViewController,带有一个 TableView 和文本字段。在其中一个文本字段中,我有一个 pickerView 作为 inputView,在 inputAccessoryView 中有一个 toolBar。当 View 加载并且我选择 firstName 文本字段并返回并移至 lastName 文本字段时,我收到约束警告。

[LayoutConstraints] 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:0x2809a4640 'assistantHeight' TUISystemInputAssistantView:0x1113b11a0.height == 45 (active)>",
"<NSLayoutConstraint:0x2809a0320 'assistantView.bottom' TUISystemInputAssistantView:0x1113b11a0.bottom == _UIKBCompatInputView:0x11a437e80.top (active)>",
"<NSLayoutConstraint:0x2809a05a0 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x1113b11a0] (active, names: '|':UIInputSetHostView:0x11d06ce50 )>",
"<NSLayoutConstraint:0x280943840 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x11a437e80] (active, names: '|':UIInputSetHostView:0x11d06ce50 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x2809a0320 'assistantView.bottom' TUISystemInputAssistantView:0x1113b11a0.bottom == _UIKBCompatInputView:0x11a437e80.top (active)>

当我在两个默认文本字段之间切换时会发生这种情况,我不明白为什么。我做了一些研究,据我所知,这是 iOS 13 的一个错误,因为在另一台装有 iOS 10 的设备上,这并没有发生。

消除此约束问题的解决方法是设置 autoCorrectionType = false。但我想启用此功能。我认为发生这种情况是因为我在 countryTextfield 的 inputView 中有一个 pickerView,但我不知道如何解决这个问题。

最佳答案

这开始发生在我的 iOS13 应用程序中,我怀疑这是一个错误。在尝试了所有我能想到的方法之后,我关闭了自动更正并不再遇到约束问题。

textEdit.autocorrectionType = .no

关于ios - 通过 UITextFields 约束问题交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61203349/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com