美文网首页
mas_updateConstraints 使用的注意事项

mas_updateConstraints 使用的注意事项

作者: 大亮code | 来源:发表于2022-08-22 10:48 被阅读0次

1.从xib拖的控件,如果已经在xib上面设置了约束,那我们想在代码中改变约束,不可以直接通过Masonry mas_updateConstraints 这个直接来改,因为Masonry不认识xib中设置的约束,会报约束冲突.可以将该约束拖进来,修改其常量.

2.mas_updateConstraints 还有一点是他的使用场景必须是: A leading (mas_update 使用的和这个必须是同一限制位置,比方说要是宽都是宽,要是leading 都是leading) B (这个需要特博尔强调的是他们约束的参考对象必须一致,否则的话还是会报约束冲突)

相关文章

网友评论

      本文标题:mas_updateConstraints 使用的注意事项

      本文链接:https://www.haomeiwen.com/subject/tihigrtx.html