代码Crash,Error崩溃集合

2016-03-18  本文已影响1639人  龙幽

1、Error :

NSInvalidArgumentException: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs

自动布局注意事项:

注意事项1:设置translatesAutoresizingMaskIntoConstraints为NO;

注意事项2:两个view在同一个hierarchy中才有可能添加相关约束。

注意事项3:当firstAttribute不为宽或者高时,multipler不能为0。

注意事项4:同上,当firstAttribute不为宽或者高时,secondItem不能为nil。

当两个Attribute全是宽或高时multiplier才可以为0;

当secondItem为nil时,secondAttribute应为NSLayoutAttributeNotAnAttribute

上一篇 下一篇

猜你喜欢

热点阅读