Masonry常见错误

1.出现NSInternalInconsistencyException错误
xcode提示:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attributes should be chained before defining the constraint relation'

看看是不是吧with写成了width
比如 make.top.mas_equalTo(self.mas_top).with.offset(50);

写成了
make.top.mas_equalTo(self.mas_top).width.offset(50);

2.couldn't find a common superview for
看看是不是少了 addSubView

你可能感兴趣的:(Masonry常见错误)