我正在使用一个包含两个UITextFields
的UIView创建一个iPad-App。
每当我运行我的App时,我单击UITextFields
中的一个,然后单击另一个(顺序无关紧要),它总是会引发错误,它必须打破约束。
我什至将两个全新的UITextFields
放在UIView上,完全没有任何约束,它仍然向我显示该错误。
[LayoutConstraints] Unable to simultaneously satisfy constraints.
(
"<NSLayoutConstraint:0x600003db4c80 'assistantHeight' TUISystemInputAssistantView:0x7fdc1f423400.height == 55 (active)>",
"<NSLayoutConstraint:0x600003dae940 'assistantView.bottom' TUISystemInputAssistantView:0x7fdc1f423400.bottom == _UIKBCompatInputView:0x7fdc1f21bb20.top (active)>",
"<NSLayoutConstraint:0x600003dae8f0 'assistantView.top' V:|-(0)-[TUISystemInputAssistantView:0x7fdc1f423400] (active, names: '|':UIInputSetHostView:0x7fdc1f432480 )>",
"<NSLayoutConstraint:0x600003da4d70 'inputView.top' V:|-(0)-[_UIKBCompatInputView:0x7fdc1f21bb20] (active, names: '|':UIInputSetHostView:0x7fdc1f432480 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003dae940 'assistantView.bottom' TUISystemInputAssistantView:0x7fdc1f423400.bottom == _UIKBCompatInputView:0x7fdc1f21bb20.top (active)>
我什至尝试了象征性的断点之类的东西,在这里您可以获得更详细的报告,但是我找不到任何线索,这里有什么问题:
UIWindow:0x7fa39f3092a0
| UITransitionView:0x7fa39f20f360
| | UIDropShadowView:0x7fa39f20fa40
| | | UIView:0x7fa39f20f880
| | | | •UIView:0x7fa39f20b690
| | | | | *<UILayoutGuide: 0x6000010e47e0 - "UIViewSafeAreaLayoutGuide", layoutFrame = {{0, 24}, {834, 1088}}, owningView = <UIView: 0x7fa39f20b690; frame = (0 0; 834 1112); autoresize = W+H; layer = <CALayer: 0x600002914fa0>>>
| | | | | *UILabel:0x7fa39f20c590'Patient:'
| | | | | *UITextField:0x7fa3a1025c00
| | | | | | _UITextFieldRoundedRectBackgroundViewNeue:0x7fa39f20ba90
| | | | | | *_UIBaselineLayoutStrut:0x7fa3a190a320
| | | | | | _UITextFieldCanvasView:0x7fa39f20b340
| | | | | *UITextField:0x7fa39f83be00
| | | | | | _UITextFieldRoundedRectBackgroundViewNeue:0x7fa39f20b140
| | | | | | *_UIBaselineLayoutStrut:0x7fa3a1909cb0
| | | | | | UIFieldEditor:0x7fa3a2815000
| | | | | | | _UITextFieldCanvasView:0x7fa39f20c1f0
| | | | | | | | UITextSelectionView:0x7fa39e40a100
| | | | | *UIButton:0x7fa39f708b60'Start'
| | | | | | UIButtonLabel:0x7fa3a19063d0'Start'
| | | | | *UILabel:0x7fa39f20d200'Sitzung:'
| | | | | *UILabel:0x7fa39f709de0'Felder dürfen nicht leer ...'
| | | | | *UIButton:0x7fa39f20d480'Daten'
| | | | | | UIButtonLabel:0x7fa3a1909300'Daten'
我在项目中是否遇到其他TextField同样的问题,我尝试了所有操作,包括将TextField放入新的View或添加/删除约束。
答案 0 :(得分:1)
问题在于您还分配了一个高度限制,因此可以删除高度限制或底部限制。否则,还有另一种解决方案,您可以将高度限制设置为“不等于”,而设置为“大于”,以确保文本字段永远不会与下面的视图重叠
答案 1 :(得分:0)
布局约束错误消息与您的布局无关。
输入助手视图是键盘内部显示的内部问题(可以认为是错误)。