我已经在Xcode(Swift 5)中构建了一个选项卡式应用程序。应用程序选项卡(有4个)可以正常工作。当前有两个加载黑页,另外两个加载Web视图(WKWebView)。 Web视图可以很好地工作,但是当使用基于Web的文本字段时,键盘几乎不会出现。
我尝试删除和调整约束,但是由于问题仍然存在,因此失败了。
以下是错误输出:
2019-06-11 20:17:51.999824+0100 TabbedApp[37023:4521411] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/james/Library/Developer/CoreSimulator/Devices/D1D0ACFE-2F91-40E6-B1EF-BF8FAB1DAC57/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2019-06-11 20:17:52.000649+0100 TabbedApp[37023:4521411] [MC] Reading from private effective user settings.
2019-06-11 20:17:52.167789+0100 TabbedApp[37023:4521411] [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:0x600003c738e0 h=-&- v=-&- _UIToolbarContentView:0x7fcc6fe1e220.width == UIToolbar:0x7fcc6fe1dbb0.width (active)>",
"<NSLayoutConstraint:0x600003c6bd40 H:|-(0)-[_UIButtonBarStackView:0x7fcc6fe207f0] (active, names: '|':_UIToolbarContentView:0x7fcc6fe1e220 )>",
"<NSLayoutConstraint:0x600003c6bd90 _UIButtonBarStackView:0x7fcc6fe207f0.trailing == _UIToolbarContentView:0x7fcc6fe1e220.trailing (active)>",
"<NSLayoutConstraint:0x600003c67200 H:|-(0)-[_UIModernBarButton:0x7fcc6fe32f60] (active, names: '|':_UIButtonBarButton:0x7fcc6fe327d0 )>",
"<NSLayoutConstraint:0x600003c67250 H:[_UIModernBarButton:0x7fcc6fe32f60]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe327d0 )>",
"<NSLayoutConstraint:0x600003c678e0 H:|-(>=5)-[_UIModernBarButton:0x7fcc6fe35590] (active, names: '|':_UIButtonBarButton:0x7fcc6fe34f20 )>",
"<NSLayoutConstraint:0x600003c67930 H:[_UIModernBarButton:0x7fcc6fe35590]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe34f20 )>",
"<NSLayoutConstraint:0x600003c6f200 H:|-(8)-[_UIModernBarButton:0x7fcc6fe363f0'Done'] (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f250 H:[_UIModernBarButton:0x7fcc6fe363f0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f610 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7fcc6fe327d0.leading (active)>",
"<NSLayoutConstraint:0x600003c6f930 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7fcc6fe228b0.trailing (active)>",
"<NSLayoutConstraint:0x600003c6f980 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe327d0]-(0)-[UIView:0x7fcc6fe34d40] (active)>",
"<NSLayoutConstraint:0x600003c6f9d0 'UISV-spacing' H:[UIView:0x7fcc6fe34d40]-(0)-[_UIButtonBarButton:0x7fcc6fe34f20] (active)>",
"<NSLayoutConstraint:0x600003c6fa20 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe34f20]-(0)-[UIView:0x7fcc6fe358d0] (active)>",
"<NSLayoutConstraint:0x600003c6fa70 'UISV-spacing' H:[UIView:0x7fcc6fe358d0]-(0)-[_UIButtonBarButton:0x7fcc6fe228b0] (active)>",
"<NSLayoutConstraint:0x600003c77b10 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7fcc6fe1dbb0.width == 0 (active)>",
"<NSLayoutConstraint:0x600003c6bac0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>",
"<NSLayoutConstraint:0x600003c6bb60 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003c67250 H:[_UIModernBarButton:0x7fcc6fe32f60]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe327d0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-06-11 20:17:52.169351+0100 TabbedApp[37023:4521411] [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:0x600003c738e0 h=-&- v=-&- _UIToolbarContentView:0x7fcc6fe1e220.width == UIToolbar:0x7fcc6fe1dbb0.width (active)>",
"<NSLayoutConstraint:0x600003c6bd40 H:|-(0)-[_UIButtonBarStackView:0x7fcc6fe207f0] (active, names: '|':_UIToolbarContentView:0x7fcc6fe1e220 )>",
"<NSLayoutConstraint:0x600003c6bd90 _UIButtonBarStackView:0x7fcc6fe207f0.trailing == _UIToolbarContentView:0x7fcc6fe1e220.trailing (active)>",
"<NSLayoutConstraint:0x600003c678e0 H:|-(>=5)-[_UIModernBarButton:0x7fcc6fe35590] (active, names: '|':_UIButtonBarButton:0x7fcc6fe34f20 )>",
"<NSLayoutConstraint:0x600003c67930 H:[_UIModernBarButton:0x7fcc6fe35590]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe34f20 )>",
"<NSLayoutConstraint:0x600003c6f200 H:|-(8)-[_UIModernBarButton:0x7fcc6fe363f0'Done'] (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f250 H:[_UIModernBarButton:0x7fcc6fe363f0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f610 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7fcc6fe327d0.leading (active)>",
"<NSLayoutConstraint:0x600003c6f930 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7fcc6fe228b0.trailing (active)>",
"<NSLayoutConstraint:0x600003c6f980 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe327d0]-(0)-[UIView:0x7fcc6fe34d40] (active)>",
"<NSLayoutConstraint:0x600003c6f9d0 'UISV-spacing' H:[UIView:0x7fcc6fe34d40]-(0)-[_UIButtonBarButton:0x7fcc6fe34f20] (active)>",
"<NSLayoutConstraint:0x600003c6fa20 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe34f20]-(0)-[UIView:0x7fcc6fe358d0] (active)>",
"<NSLayoutConstraint:0x600003c6fa70 'UISV-spacing' H:[UIView:0x7fcc6fe358d0]-(0)-[_UIButtonBarButton:0x7fcc6fe228b0] (active)>",
"<NSLayoutConstraint:0x600003c77b10 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7fcc6fe1dbb0.width == 0 (active)>",
"<NSLayoutConstraint:0x600003c6bac0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>",
"<NSLayoutConstraint:0x600003c6bb60 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003c67930 H:[_UIModernBarButton:0x7fcc6fe35590]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe34f20 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-06-11 20:17:52.170629+0100 TabbedApp[37023:4521411] [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:0x600003c738e0 h=-&- v=-&- _UIToolbarContentView:0x7fcc6fe1e220.width == UIToolbar:0x7fcc6fe1dbb0.width (active)>",
"<NSLayoutConstraint:0x600003c6bd40 H:|-(0)-[_UIButtonBarStackView:0x7fcc6fe207f0] (active, names: '|':_UIToolbarContentView:0x7fcc6fe1e220 )>",
"<NSLayoutConstraint:0x600003c6bd90 _UIButtonBarStackView:0x7fcc6fe207f0.trailing == _UIToolbarContentView:0x7fcc6fe1e220.trailing (active)>",
"<NSLayoutConstraint:0x600003c6f200 H:|-(8)-[_UIModernBarButton:0x7fcc6fe363f0'Done'] (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f250 H:[_UIModernBarButton:0x7fcc6fe363f0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>",
"<NSLayoutConstraint:0x600003c6f610 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7fcc6fe327d0.leading (active)>",
"<NSLayoutConstraint:0x600003c6f930 'UISV-canvas-connection' UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7fcc6fe228b0.trailing (active)>",
"<NSLayoutConstraint:0x600003c6f980 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe327d0]-(0)-[UIView:0x7fcc6fe34d40] (active)>",
"<NSLayoutConstraint:0x600003c6f9d0 'UISV-spacing' H:[UIView:0x7fcc6fe34d40]-(0)-[_UIButtonBarButton:0x7fcc6fe34f20] (active)>",
"<NSLayoutConstraint:0x600003c6fa20 'UISV-spacing' H:[_UIButtonBarButton:0x7fcc6fe34f20]-(0)-[UIView:0x7fcc6fe358d0] (active)>",
"<NSLayoutConstraint:0x600003c6fa70 'UISV-spacing' H:[UIView:0x7fcc6fe358d0]-(0)-[_UIButtonBarButton:0x7fcc6fe228b0] (active)>",
"<NSLayoutConstraint:0x600003c77b10 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7fcc6fe1dbb0.width == 0 (active)>",
"<NSLayoutConstraint:0x600003c6bac0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>",
"<NSLayoutConstraint:0x600003c6bb60 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000026347e0'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x7fcc6fe207f0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003c6f250 H:[_UIModernBarButton:0x7fcc6fe363f0'Done']-(0)-| (active, names: '|':_UIButtonBarButton:0x7fcc6fe228b0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
我希望键盘看起来像在使用Web视图构建的其他应用程序中一样,但这是我第一次遇到此问题。我希望它可能是我可能错过的简单事物。我不确定还有什么尝试的方法,因此不胜感激。我以为我必须给键盘优先,但是我可能还差得远...