[报错]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 ...
随机推荐
- eclipse配置xml的自动提示
如mybatis的mapper配置文件: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ...
- JSON特殊字符的处理
本文转自:http://blog.csdn.net/btt2013/article/details/66970735 JSon 数据中的String 传递数据时,需要处理好特殊字符. JSon数据中有 ...
- java向MySQL插入当前时间的四种方式和java时间日期格式化的几种方法(案例说明)
转载地址:http://www.devba.com/index.php/archives/4581.html java向MySQL插入当前时间的四种方式和java时间日期格式化的几种方法(案例说明); ...
- 数论 + 容斥 - HDU 4059 The Boss on Mars
The Boss on Mars Problem's Link Mean: 给定一个整数n,求1~n中所有与n互质的数的四次方的和.(1<=n<=1e8) analyse: 看似简单,倘若 ...
- IoC就是IoC,不是什么技术,与GoF一样,是一种设计模式。
IoC就是IoC,不是什么技术,与GoF一样,是一种设计模式. InterfaceDrivenDesign接口驱动,接口驱动有很多好处,可以提供不同灵活的子类实现,增加代码稳定和健壮性等等,但是接口一 ...
- AJAX解惑篇(转)
这篇文章会使你对AJAX有一个基本了解,并给出两个容易上手的例子. 什么是AJAX AJAX是一个新的合成术语,隐含了两个已经存在多年的JavaScript特性,但是直到最近,随着一些诸如Gmail. ...
- XMPP客户端
1. Strophe.js 2. Converse.js
- MySQL单列索引和组合索引的选择效率与explain分析
一.先阐述下单列索引和组合索引的概念: 单列索引:即一个索引只包含单个列,一个表可以有多个单列索引,但这不是组合索引. 组合索引:即一个索包含多个列. 如果我们的查询where条件只有一个,我们完全可 ...
- C#正则表达式操作中使用LINQ
比如:[程序员][代码]博客园 - 程序员的网上家园,代码改变世界 提取出来的Tag应该是:[程序员].[代码] Regex _regexTag = new Regex(@"^(\[[^\] ...
- Linq------错误:EntityType: EntitySet 'Products' is based on type 'Product' that has no keys defined.
解决方法: [Table("bma_products")] public class Product { //加上[Key]即可 [Key] public int pid{get; ...