当 UITextField
获得焦点并且我选择不同的 UITextField
时,我收到以下错误(仅限 `iPad):
[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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) ( "<NSAutoresizingMaskLayoutConstraint:0x60400028fa50 h=--& v=--& UIKeyboardAssistantBar:0x7f8895c0e5f0.height == 0 (active)>", "<NSLayoutConstraint:0x60c000289d30 V:|-(0)-[_UIButtonBarStackView:0x7f8895c11180] (active, names: '|':UIKeyboardAssistantBar:0x7f8895c0e5f0 )>", "<NSLayoutConstraint:0x60c00028b130 V:[_UIButtonBarStackView:0x7f8895c11180]-(0)-| (active, names: '|':UIKeyboardAssistantBar:0x7f8895c0e5f0 )>", "<NSLayoutConstraint:0x60400028ec90 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f8895e2f950.height == UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide'.height (active)>", "<NSLayoutConstraint:0x60c000285f50 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide']-(9)-| (active, names: '|':_UIButtonBarStackView:0x7f8895c11180 )>", "" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60c000285f50 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x60c0001a7700'UIViewLayoutMarginsGuide']-(9)-| (active, names: '|':_UIButtonBarStackView:0x7f8895c11180 )>
注意
我正在使用 UICollectionViewController
并且我所有的 UITextFields
都在 UICollectionViewCells
中。
我遇到的问题似乎与 this 相同.另外,我的键盘类型是十进制。
最佳答案
如果我在切换 TextFields
之前按 command + k
,那么我不会收到任何约束错误。
关于ios - iPad版TextFields切换时出现约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51442316/