[报错]Unable to simultaneously satisfy constraints
项目中自定义Cell,控件使用autoLayout来设置约束,发现运行页面表现正常,但是控制台报如下错误:
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
() look at each constraint and try to figure out which you don't expect;
() find the code that added the unwanted constraint or constraints and fix it.
(
<NSLayoutConstraint:0x10c30ee10 V:[UILabel:0x10c30ebb0'Label'(21.6667)]>,
<NSLayoutConstraint:0x10c30f9c0 V:[UIView:0x10c30ea20()]>,
<NSLayoutConstraint:0x10c30fab0 V:|-()-[UILabel:0x10c30ebb0'Label'] (Names: '|':UIView:0x10c30ea20 )>,
<NSLayoutConstraint:0x10c30fb00 V:[UILabel:0x10c30ebb0'Label']-()-[UILabel:0x10c30f080'Label']>,
<NSLayoutConstraint:0x10c30fb50 UILabel:0x10c30f080'Label'.height == UILabel:0x10c30ebb0'Label'.height>,
<NSLayoutConstraint:0x10c30fc90 V:[UILabel:0x10c30f3d0'Label']-()-| (Names: '|':UIView:0x10c30ea20 )>,
<NSLayoutConstraint:0x10c30fd80 V:[UILabel:0x10c30f080'Label']-()-[UILabel:0x10c30f3d0'Label']>
) Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x10c30ee10 V:[UILabel:0x10c30ebb0'Label'(21.6667)]> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
问题:
表示约束发生冲突,查看错误信息,其中一个label报约束冲突:
发现在cell中设置的label高度为21.6
但实际代码中计算的label高度为21.667,并设置label高度约束为21.667
说明label约束冲突了
解决办法:
在cell中找到这个label,找到这个label的高度约束,对其优先级进行减一操作,
以前是1000,改为999,即当xib中设置的高度约束与代码中更新的高度约束不一致时,
取代码中设置的值。

[报错]Unable to simultaneously satisfy constraints的更多相关文章
- 自动布局报错(两条连线冲突):Unable to simultaneously satisfy constraints
这个报错有些长: Unable to simultaneously satisfy constraints. Probably at least one of the constraints i ...
- cordova for ios: Unable to simultaneously satisfy constraints.
使用cordova开发ios项目的时候,在上传图片碰到一个问题.使用html的<input type="file"/>标签来选择照片或者拍照片,引起了布局报错,然后图片 ...
- Unable to simultaneously satisfy constraints.
在进行版本的迭代更新时,新功能需求需要对主页面的UI进行重新的布局,但是,报了错误,出了好多约束方面的问题: Unable to simultaneously satisfy constraints. ...
- delphi调试需要管理员权限程序报错“Unable to create process:请求的操作需要提升”
delphi调试启动需要UAC权限的程序的时候会报错“Unable to create process:请求的操作需要提升”.这是因为delphi没有以管理员身份启动,这样delphi createp ...
- AS添加依赖报错Unable to merge dex
AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...
- centos6.5环境wget报错Unable to establish SSL connection
centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...
- linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”
linux 下通过xhost进入图形界面,经常会出现报错“unable to open display” linux下的操作步骤如下: [root@localhost ~]# vncserver N ...
- git clone 报错Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
在执行git clone命令报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching key exchange metho ...
- Git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx port 12345: no matching cipher found. Their offer: aes128-cbc,3des-cbc,blowfish-cbc
git clone 报错 Unable to negotiate with xxx.xxx.xxx.xxx. port 12345: no matching cipher found. Their o ...
随机推荐
- js 实现依赖注入的思想,后端框架思想搬到前端来
前述:咱们写一些页面的时候,很多需要用ajax来实现,显示又有很多表单提交的add或者update操作,太烦了,能不能有什么方法能够简单些呢? 说实话我都是被公司给逼的 应用场景: 前后端一一对应.表 ...
- MongoDB随笔
创建用户 db.createUser({user: "abc",pwd: "abc123",roles: [ { role: "readWrite&q ...
- ehcache 在集群环境下 出现 Cause was not due to an IOException or NotBoundException
RMI 远程调用地址不正确导致 <?xml version="1.0" encoding="UTF-8"?> <ehcache> < ...
- TOTP:Time-based One-time Password Algorithm(基于时间的一次性密码算法)
TOTP:Time-based One-time Password Algorithm(基于时间的一次性密码算法) TOTP - Time-based One-time Password Algori ...
- Scrum培训心得体会
# Scrum培训心得体会 非常荣幸能够参加公司组织的这场为期两天的培训,赛宝的老师讲的非常好.通过这次学习,理解了当前最流行的Scrum开发框架,下面总结了我对Scrum的理解. ## scrum的 ...
- oracle 表空间 数据文件 表的关系
数据文件是表空间的容器,增加数据文件是增大表空间的容量,而不是往表空间里添加数据因此数据文件肯定能添加,如果表空间用完了,再添加新的数据就会报错你可以这样理解,数据库是一个箱子,表空间是箱子里的抽屉, ...
- Unix系统编程()信号处理器简介
信号处理器简介 信号处理器程序(也称为信号捕捉器)是当指定信号传递给进程时将会调用的一个函数.这里会学习信号处理器的基本原理,后面将继续学习. 调用信号处理器程序,可能会随时打断主程序流程:内核代表进 ...
- 《高性能MySQL》读书笔记(1)
慢查询 当一个资源变得效率低下的时候,应该了解一下为什么会这样.有如下可能原因:1.资源被过度使用,余量已经不足以正常工作.2.资源没有被正确配置3.资源已经损坏或者失灵 因为慢查询,太多查询的实践过 ...
- 在.net4的环境下使用Microsoft.AspNet.SignalR.Client 2.4.0
我的环境是运行在.net 4 framework,并且使用了signalr 在重连的时候发现,运行的服务被关闭了.找不到合适的处理的办法.因为报错是 说明: 由于未经处理的异常,进程终止.异常信息: ...
- Android基础总结(二)布局,存储
常见布局 相对布局 RelativeLayout 组件默认左对齐.顶部对齐 设置组件在指定组件的右边 android:layout_toRightOf="@id/tv1" 设置在指 ...