将焦点从UITextView更改为UITextField打破了约束

时间:2018-07-18 20:02:46

标签: ios swift

当我单击将焦点从UITextView更改为UITextField时,将获得以下控制台输出。 UITextView必须首先具有焦点,以便键盘已经显示。

这似乎只有在我在选择了“连接硬件键盘”的iPad上进行测试时才会发生。有什么我可以纠正的方法吗?使用Xcode 9.4.1。

2018-07-18 14:59:38.154928-0500 SingleViewTest[12870:502137] [MC] System group container for systemgroup.com.apple.configurationprofiles path is ...
2018-07-18 14:59:38.163269-0500 SingleViewTest[12870:502137] [MC] Reading from private effective user settings.
2018-07-18 14:59:39.084531-0500 SingleViewTest[12870:502137] [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:0x60c000284ce0 h=--& v=--& UIKeyboardAssistantBar:0x7f9b6840e5c0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60800009e230 V:|-(0)-[_UIButtonBarStackView:0x7f9b6840f240]   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60800009e280 V:[_UIButtonBarStackView:0x7f9b6840f240]-(0)-|   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60c000281900 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f9b68644c70.height == UILayoutGuide:0x6080001b5540'UIViewLayoutMarginsGuide'.height   (active)>",
    "<NSLayoutConstraint:0x60800009d6f0 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b5540'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b6840f240 )>",
    "<NSLayoutConstraint:0x60800009d650 'UIView-topMargin-guide-constraint' V:|-(10)-[UILayoutGuide:0x6080001b5540'UIViewLayoutMarginsGuide']   (active, names: '|':_UIButtonBarStackView:0x7f9b6840f240 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60800009d6f0 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b5540'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b6840f240 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-07-18 14:59:39.085841-0500 SingleViewTest[12870:502137] [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:0x60c000284ce0 h=--& v=--& UIKeyboardAssistantBar:0x7f9b6840e5c0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60800009e2d0 V:|-(0)-[_UIButtonBarStackView:0x7f9b6840fff0]   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60800009e320 V:[_UIButtonBarStackView:0x7f9b6840fff0]-(0)-|   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60c000283660 'UIButtonBar.maximumAlignmentSize' UIView:0x7f9b684117d0.height == UILayoutGuide:0x6080001b58c0'UIViewLayoutMarginsGuide'.height   (active)>",
    "<NSLayoutConstraint:0x60800009da10 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b58c0'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b6840fff0 )>",
    "<NSLayoutConstraint:0x60800009d970 'UIView-topMargin-guide-constraint' V:|-(10)-[UILayoutGuide:0x6080001b58c0'UIViewLayoutMarginsGuide']   (active, names: '|':_UIButtonBarStackView:0x7f9b6840fff0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60800009da10 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b58c0'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b6840fff0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2018-07-18 14:59:39.086724-0500 SingleViewTest[12870:502137] [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:0x60c000284ce0 h=--& v=--& UIKeyboardAssistantBar:0x7f9b6840e5c0.height == 0   (active)>",
    "<NSLayoutConstraint:0x60800009e1e0 V:|-(0)-[_UIButtonBarStackView:0x7f9b68410d80]   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60800009e370 V:[_UIButtonBarStackView:0x7f9b68410d80]-(0)-|   (active, names: '|':UIKeyboardAssistantBar:0x7f9b6840e5c0 )>",
    "<NSLayoutConstraint:0x60c000283f20 'UIButtonBar.maximumAlignmentSize' _UIButtonBarButton:0x7f9b6864e560.height == UILayoutGuide:0x6080001b5c40'UIViewLayoutMarginsGuide'.height   (active)>",
    "<NSLayoutConstraint:0x60800009dd30 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b5c40'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b68410d80 )>",
    "<NSLayoutConstraint:0x60800009dc90 'UIView-topMargin-guide-constraint' V:|-(10)-[UILayoutGuide:0x6080001b5c40'UIViewLayoutMarginsGuide']   (active, names: '|':_UIButtonBarStackView:0x7f9b68410d80 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60800009dd30 'UIView-bottomMargin-guide-constraint' V:[UILayoutGuide:0x6080001b5c40'UIViewLayoutMarginsGuide']-(9)-|   (active, names: '|':_UIButtonBarStackView:0x7f9b68410d80 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

编辑:单击按钮后UITextView失去焦点时,会出现类似的消息。

编辑:storyboard

0 个答案:

没有答案