Will attempt to recover by breaking constraint <NSLayoutConstraint:0x280764780 H:[_UIModernBarButton:0x143dae800]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x143dae1b0 )>
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-07-09 09:42:56.139575+0800 imatrixh5app[1006:633541] [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:0x280764960 h=-&- v=-&- _UIToolbarContentView:0x143d4f810.width == UIToolbar:0x143d4f3d0.width (active)>", "<NSLayoutConstraint:0x28075b200 H:|-(0)-[_UIButtonBarStackView:0x143d50bd0] (active, names: '|':_UIToolbarContentView:0x143d4f810 )>", "<NSLayoutConstraint:0x28075bf70 _UIButtonBarStackView:0x143d50bd0.trailing == _UIToolbarContentView:0x143d4f810.trailing (active)>", "<NSLayoutConstraint:0x280766990 H:|-(8)-[_UIModernBarButton:0x143daf8b0'Done'] (active, names: '|':_UIButtonBarButton:0x143daed20 )>", "<NSLayoutConstraint:0x280766350 H:[_UIModernBarButton:0x143daf8b0'Done']-(16)-| (active, names: '|':_UIButtonBarButton:0x143daed20 )>", "<NSLayoutConstraint:0x28077fc50 'UISV-canvas-connection' UILayoutGuide:0x281d4ea00'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x143e68f40.leading (active)>", "<NSLayoutConstraint:0x28077fc00 'UISV-canvas-connection' UILayoutGuide:0x281d4ea00'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x143daed20.trailing (active)>", "<NSLayoutConstraint:0x280767b60 'UISV-spacing' H:[_UIButtonBarButton:0x143e68f40]-(0)-[UIView:0x143dadfd0] (active)>", "<NSLayoutConstraint:0x2807661c0 'UISV-spacing' H:[UIView:0x143dadfd0]-(0)-[_UIButtonBarButton:0x143dae1b0] (active)>", "<NSLayoutConstraint:0x280767cf0 'UISV-spacing' H:[_UIButtonBarButton:0x143dae1b0]-(0)-[UIView:0x143daeb40] (active)>", "<NSLayoutConstraint:0x280767e80 'UISV-spacing' H:[UIView:0x143daeb40]-(0)-[_UIButtonBarButton:0x143daed20] (active)>",
"<NSLayoutConstraint:0x2807671b0 'UIView-Encapsulated-Layout-Width' UIToolbar:0x143d4f3d0.width == 0 (active)>",
"<NSLayoutConstraint:0x2807597c0 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x281d4ea00'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIButtonBarStackView:0x143d50bd0 )>",
"<NSLayoutConstraint:0x28075b480 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x281d4ea00'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x143d50bd0 )>"
)
Will attempt to recover by breaking constraint <NSLayoutConstraint:0x280766350 H:[_UIModernBarButton:0x143daf8b0'Done']-(16)-| (active, names: '|':_UIButtonBarButton:0x143daed20 )>
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-07-09 09:43:00.332944+0800 imatrixh5app[1006:633541] didDisconnectPeripheral 2019-07-09 09:43:17.569429+0800 imatrixh5app[1006:633541] didConnectPeripheral 2019-07-09 09:43:19.459614+0800 imatrixh5app[1006:633541] didDisconnectPeripheral
1
paullee 2019-07-09 09:54:17 +08:00
这个是你加了 Alert Actionsheet 出来的吧,我查到的资料说是 iOS12.x 的 bug。。。
|
2
paullee 2019-07-09 09:55:26 +08:00
另外,我是业余选手,不具有参考性哈。
|
3
jameskuk 2019-07-09 09:57:29 +08:00
约束冲突了,自己查查自己的约束,口算一下
|
4
aria955 OP |
5
arnoldxiao 2019-07-09 10:21:17 +08:00
约束冲突,仔细核查
|
6
vincentxue 2019-07-09 10:42:58 +08:00
这就是约束冲突了。
约束就是 Auto Layout 的约束,具体类是 NSLayoutConstraint。打开生成的 Xcode 工程,打个名叫 UIViewAlertForUnsatisfiableConstraints 的 symbolic 断点,怎么打可以谷歌一下。还有其他方法做调试,详见官方文档: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/DebuggingTricksandTips.html 具体来说,你是下面两个约束冲突了: "<NSLayoutConstraint:0x280766990 H:|-(8)-[_UIModernBarButton:0x143daf8b0'Done'] (active, names: '|':_UIButtonBarButton:0x143daed20 )>", "<NSLayoutConstraint:0x280766350 H:[_UIModernBarButton:0x143daf8b0'Done']-(16)-| (active, names: '|':_UIButtonBarButton:0x143daed20 )>", 第一个你要求 Done button 在水平方向上与父视图左侧的间距是 8,第二条你要求 Done button 水平方向上距离父视图左侧的间距是 0。这肯定会冲突了。 系统已经帮你去掉了第二条,你好好检查一下你的 layout 代码。 另外这种布局叫做 VFL 语法,可以参见我以前的一篇博客。https://xuexuefeng.com/autolayout/ |