使用Masonry时出现 [LayoutConstraints] Unable to simultaneously satisfy constraints

使用Masonry时出现

[LayoutConstraints] Unable to simultaneously satisfy constraints.

Probably at least one of the constraints in the following list is one you don't want. 

Try this: 

(1) look at each constraint and try to figure out which you don't expect; 

(2) find the code that added the unwanted constraint or constraints and fix it. 

至于解决方案,就是对view内部使用Masonry布局的空间添加布局优先级,就可以移除这些警告了。

例如:

[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker*make){make.edges.equalTo(self);}];

修改为:

[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker*make){make.edges.equalTo(self).priorityHigh();}];

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。