Ios 视图和superview之间的NSSpace属性必须匹配(自动布局)

Ios 视图和superview之间的NSSpace属性必须匹配(自动布局),ios,swift,autolayout,Ios,Swift,Autolayout,我在viewcontroller中具有以下视图层次结构: 视图->子视图->按钮 按钮必须按屏幕总宽度的一定比例放置在右侧。子视图(按钮的超级视图)的前导和尾随约束为零。现在在故事板中,我对按钮的前缘有以下约束: 按钮。前导=343/375*尾随 当我运行应用程序时,按钮位于正确的位置,但出现以下自动布局错误: [LayoutConstraints] Could not resolve symbolic constant for constraint, because: Attributes m

我在viewcontroller中具有以下视图层次结构:

视图->子视图->按钮

按钮必须按屏幕总宽度的一定比例放置在右侧。子视图(按钮的超级视图)的前导和尾随约束为零。现在在故事板中,我对按钮的前缘有以下约束:

按钮。前导=343/375*尾随

当我运行应用程序时,按钮位于正确的位置,但出现以下自动布局错误:

[LayoutConstraints] Could not resolve symbolic constant for constraint, because: Attributes must match for NSSpace between view and superview.
mismatched attributes: leading of <UIButton: 0x7f86efd51410; frame = (378.667 -1.33333; 8 21); opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x600000433780>>, and trailing of <UIView: 0x7f86efe42410; frame = (0 60; 414 277); autoresize = RM+BM; gestureRecognizers = <NSArray: 0x600000447830>; layer = <CALayer: 0x60c000238660>>
Use a symbolic breakpoint at NSLayoutConstraintFailedToFindDefaultResolvedValueForSymbolicConstant to debug.
[LayoutConstraints]无法解析约束的符号常量,因为:视图和superview之间的NSSpace属性必须匹配。
不匹配的属性:的前导和尾随
在NSLayoutConstraintFailedTofIndedFaultResolvedValueForSymbolicConstant处使用符号断点进行调试。

打开interface builder,找到约束导致错误,并尝试将常量字段中的值从
标准更改为
0