ios代码添加NSLayoutConstraint的问题

Q1spa

在工做中发现,须要代码添加NSLayoutConstraint的时候,发现出现以下问题:
ast

Unable to simultaneously satisfy constraints.im

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

解决方案: 设置view的translatesAutoresizingMaskIntoConstraints的属性为NO便可解决view


Q2vi

出现以下问题:The view hierarchy is not prepared for the constraint:ant

解决方案:先将view添加到superview上,而后再添加NSLayoutConstraint约束条件便可解决解决方案

相关文章
相关标签/搜索