1)之前项目中出现过类似的警告问题,由于懒因为查找什么情况。最近的一个项目又遇到了如此的问题,实在忍受不了 于是找解决办法. 问题如下:
![解决storyboard约束警告 解决storyboard约束警告](https://i-blog.csdnimg.cn/blog_migrate/3611f6f10fea27e8d2cfae48121134a0.jpeg)
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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints
[
NSLayoutConstraint:0x17489f2c0 H:[UIImageView:0x130b480e0(580)
NSLayoutConstraint:0x174a80280 H:|-(10)-[UIImageView:0x130b48ae0] (Names: '|':UIView:0x130b43ff0 )
NSLayoutConstraint:0x174a80320 UIIma
g
eView:0x130b48ae0.leading == UIImageView:0x130b480e0.leadin
NSLayoutConstraint:0x174a81860 H:[UIImageView:0x130aac740]-(10)-| (Names: '|':UIView:0x130b43ff0 )
NSLayoutConstraint:0x174a819f0 UIImageView:0x130aac740.trailing == UIImageView:0x130b480e0.trailing>,
NSLayoutConstraint:0x174a81cc0 H:[UIView:0x130b43ff0]-(0)-| (Names: '|':UITableViewCellContentView:0x130b44a40 )
NSLayoutConstraint:0x174a81d10 H:|-(0)-[UIView:0x130b43ff0] (Names: '|':UITableViewCellContentView:0x130b44a40 )
NSLayoutConstraint:0x174a869f0 'UIView-Encapsulated-Layout-Width' H:[UITableViewCellContentView:0x130b44a40(375)]
])
Will attempt to recover by breaking constraint
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
如何解决此问题?答案如下:
先看上面表绿色的UIimageView对象指针 ,去找你的Storyboard中的对象,你找到这个对象 看下约束情况就明白了,肯定是约束冲突 设置有问题,我的问题如下:
2)另外还有一个约束警告如下:
![解决storyboard约束警告 解决storyboard约束警告](https://i-blog.csdnimg.cn/blog_migrate/dcc542798624bc90522b4d17a5c7b63d.jpeg)
warning: Attribute Unavailable: Automatic Preferred Max Layout Width is not available on iOS versions prior to 8.0
解决办法如下:
总结: 使用约束的时候一定要注意,约束间的关系 别误加约束,像这种不可避免的问题,还是要学会解决办法。
This link米农 码农blog搭建中... 欢迎访问!