您的位置:首页 > 大数据 > 人工智能

Assertion failure in -[MASViewConstraint addConstraintWithLayoutAttribute:],'Attributes should be ch

2017-04-06 16:29 495 查看
使用Masonry一不小心就会出现各种问题。

今天的问题大概是这样的:

Assertion failure in -[MASViewConstraint addConstraintWithLayoutAttribute:],

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attributes should be chained before defining the constraint relation'

控制台截图:



错误原因:

_operationButton 是一个按钮,添加了如下约束



图中红色圈中的width应该修改成with。这里不是设置宽度,是给当前的约束添加附加条件(我这里是偏移量),应该用介词with,而不是width。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐