Ios 自动布局-无法同时满足swift5中的约束
我的问题发生在您按下web视图侧栏上的按钮时。该按钮向web视图发送简单消息并复制剪贴板。斯威夫特向您展示收到的消息,作为祝酒词。这很简单 功能似乎没有问题 但用户界面是个问题。按下按钮时,屏幕从上到下滑动,显示烤面包片,再次按下按钮可激活按下侧边栏上另一个按钮的功能 屏幕是一样的,但屏幕似乎是向下的。侧边栏屏幕包含一个滚动条。这就是为什么 错误日志:Ios 自动布局-无法同时满足swift5中的约束,ios,swift,storyboard,Ios,Swift,Storyboard,我的问题发生在您按下web视图侧栏上的按钮时。该按钮向web视图发送简单消息并复制剪贴板。斯威夫特向您展示收到的消息,作为祝酒词。这很简单 功能似乎没有问题 但用户界面是个问题。按下按钮时,屏幕从上到下滑动,显示烤面包片,再次按下按钮可激活按下侧边栏上另一个按钮的功能 屏幕是一样的,但屏幕似乎是向下的。侧边栏屏幕包含一个滚动条。这就是为什么 错误日志: Unable to simultaneously satisfy constraints. Probably at least one
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:0x283a866c0 h=-&- v=-&- _UIToolbarContentView:0x133ebf3b0.width == UIToolbar:0x133ebef70.width (active)>",
"<NSLayoutConstraint:0x283a8b390 H:|-(0)-[_UIButtonBarStackView:0x133ec0570] (active, names: '|':_UIToolbarContentView:0x133ebf3b0 )>",
"<NSLayoutConstraint:0x283a8b3e0 _UIButtonBarStackView:0x133ec0570.trailing == _UIToolbarContentView:0x133ebf3b0.trailing (active)>",
"<NSLayoutConstraint:0x283a84910 H:|-(16)-[_UIModernBarButton:0x133dcc420] (active, names: '|':_UIButtonBarButton:0x133dcc1d0 )>",
"<NSLayoutConstraint:0x283a84960 H:[_UIModernBarButton:0x133dcc420]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x133dcc1d0 )>",
"<NSLayoutConstraint:0x283a84f50 H:|-(>=5)-[_UIModernBarButton:0x133ecbe60] (active, names: '|':_UIButtonBarButton:0x133ecbc10 )>",
"<NSLayoutConstraint:0x283a84fa0 H:[_UIModernBarButton:0x133ecbe60]-(>=5)-| (active, names: '|':_UIButtonBarButton:0x133ecbc10 )>",
"<NSLayoutConstraint:0x283a856d0 H:|-(8)-[_UIModernBarButton:0x133dcd540'Done'] (active, names: '|':_UIButtonBarButton:0x133ecc380 )>",
"<NSLayoutConstraint:0x283a85720 H:[_UIModernBarButton:0x133dcd540'Done']-(16)-| (active, names: '|':_UIButtonBarButton:0x133ecc380 )>",
"<NSLayoutConstraint:0x283a85ae0 'UISV-canvas-connection' UILayoutGuide:0x2820c1c00'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x133dcc1d0.leading (active)>",
"<NSLayoutConstraint:0x283a85cc0 'UISV-canvas-connection' UILayoutGuide:0x2820c1c00'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x133ecc380.trailing (active)>",
"<NSLayoutConstraint:0x283a85d10 'UISV-spacing' H:[_UIButtonBarButton:0x133dcc1d0]-(0)-[UIView:0x133e94d90] (active)>",
"<NSLayoutConstraint:0x283a85d60 'UISV-spacing' H:[UIView:0x133e94d90]-(0)-[_UIButtonBarButton:0x133ecbc10] (active)>",
"<NSLayoutConstraint:0x283a85db0 'UISV-spacing' H:[_UIButtonBarButton:0x133ecbc10]-(0)-[UIView:0x133ecc1a0] (active)>",
"<NSLayoutConstraint:0x283a85e00 'UISV-spacing' H:[UIView:0x133ecc1a0]-(0)-[_UIButtonBarButton:0x133ecc380] (active)>",
"<NSLayoutConstraint:0x283a835c0 'UIView-Encapsulated-Layout-Width' UIToolbar:0x133ebef70.width == 0 (active)>",
"<NSLayoutConstraint:0x283a8b250 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x2820c1c00'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIButtonBarStackView:0x133ec0570 )>",
"<NSLayoutConstraint:0x283a8b2f0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x2820c1c00'UIViewLayoutMarginsGuide']-(0)-|(LTR) (active, names: '|':_UIButtonBarStackView:0x133ec0570 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x283a84960 H:[_UIModernBarButton:0x133dcc420]-(>=8)-| (active, names: '|':_UIButtonBarButton:0x133dcc1d0 )>
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.
JSP按钮视图
<div class="w" id="user"></div>
<div class="b-copy">
<button type="button" class="btn" onclick="copy_address()">copy</button>
<input type="text" id="copy_text" style="display: none;">
</div>
我通过模拟器发现了这个问题 当我用我真正的iPhone检查时,屏幕看起来像是从上到下的,因为我看不到键盘,但实际上只是一个短暂的外观,然后就消失了 这就是为什么工具栏的高度有问题。键盘出现问题的原因是JS函数
t.select();
document.execCommand('copy');
由于这一部分,键盘可见并消失了。所以我通过搜索解决了这个问题
t.readOnly=true;
我通过添加此代码解决了问题。我通过模拟器发现了问题所在 当我用我真正的iPhone检查时,屏幕看起来像是从上到下的,因为我看不到键盘,但实际上只是一个短暂的外观,然后就消失了 这就是为什么工具栏的高度有问题。键盘出现问题的原因是JS函数
t.select();
document.execCommand('copy');
由于这一部分,键盘可见并消失了。所以我通过搜索解决了这个问题
t.readOnly=true;
我通过添加此代码解决了问题。@matt我没有使用UIToolbar。我的工具栏在哪里?@matt我不使用工具栏。您可以通过查看我的屏幕截图来了解为什么我不使用工具栏时会出现错误?我没有按工具栏按钮,只是在web视图中按了按钮。我使用Toaster模块向toast发送消息。边栏是web视图中的边栏。非常抱歉,我以前从未使用过工具栏,所以我不知道它在哪里。我们该怎么办?@matt我不使用UIToolbar。我的工具栏在哪里?@matt我不使用工具栏。您可以通过查看我的屏幕截图来了解为什么我不使用工具栏时会出现错误?我没有按工具栏按钮,只是在web视图中按了按钮。我使用Toaster模块向toast发送消息。边栏是web视图中的边栏。非常抱歉,我以前从未使用过工具栏,所以我不知道它在哪里。我们该怎么办?