Masonry约束崩溃

报错:

Trapped uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: A constraint cannot be made between a leading/trailing attribute and a right/left attribute. Use leading/trailing for both or neither.'

堆栈信息:

 

原因:你在制定约束时,约束的对象和参考对象没有使用同一约束的成员属性,如下:

前面使用leading那么后者也要用leading,保持前后一致就好。

 

posted @ 2016-09-27 10:08  nenhallwu  阅读(1097)  评论(0编辑  收藏  举报