项目中自定义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的更多相关文章

  1. 自动布局报错(两条连线冲突):Unable to simultaneously satisfy constraints

    这个报错有些长: Unable to simultaneously satisfy constraints.    Probably at least one of the constraints i ...

  2. cordova for ios: Unable to simultaneously satisfy constraints.

    使用cordova开发ios项目的时候,在上传图片碰到一个问题.使用html的<input type="file"/>标签来选择照片或者拍照片,引起了布局报错,然后图片 ...

  3. Unable to simultaneously satisfy constraints.

    在进行版本的迭代更新时,新功能需求需要对主页面的UI进行重新的布局,但是,报了错误,出了好多约束方面的问题: Unable to simultaneously satisfy constraints. ...

  4. delphi调试需要管理员权限程序报错“Unable to create process:请求的操作需要提升”

    delphi调试启动需要UAC权限的程序的时候会报错“Unable to create process:请求的操作需要提升”.这是因为delphi没有以管理员身份启动,这样delphi createp ...

  5. AS添加依赖报错Unable to merge dex

    AS添加依赖报错Unable to merge dex 最近在给项目添加依赖的时候,要给项目导入Bmob的SDK,参照Bmob的官方文档,可以直接在app的build.gradle文件中添加 //Bm ...

  6. centos6.5环境wget报错Unable to establish SSL connection

    centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...

  7. linux 下通过xhost进入图形界面,经常会出现报错“unable to open display”

    linux 下通过xhost进入图形界面,经常会出现报错“unable to  open display” linux下的操作步骤如下: [root@localhost ~]# vncserver N ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. Struts2源码阅读(一)_Struts2框架流程概述

    1. Struts2架构图  当外部的httpservletrequest到来时 ,初始到了servlet容器(所以虽然Servlet和Action是解耦合的,但是Action依旧能够通过httpse ...

  2. 内存对齐与ANSI C中struct型数据的内存布局

    当在C中定义了一个结构类型时,它的大小是否等于各字段(field)大小之和?编译器将如何在内存中放置这些字段?ANSI C对结构体的内存布局有什么要求?而我们的程序又能否依赖这种布局?这些问题或许对不 ...

  3. m4--宏处理器

    m4 是 POSIX 标准中的一部分,所有版本的 UNIX 下都可用.虽然这种语言可以单独使用,但大多数人需要 m4 仅仅是因为 GNU autoconf 中的 “configure” 脚本依赖它.宏 ...

  4. REST学习

    RPC架构与REST架构 RPC:RPC将服务器看作一些列动作的集合(需要做某件事) REST:将服务器看作分布式对象集合,客户端通过调用这些对象上的方法来执行特定的任务,组件交互的可伸缩性.接口的通 ...

  5. (壹)、java面向对象详解

    面向对象的概述: 1.用java语言对现实生活中的事物进行描述.通过类的形式来体现的. 2.怎么描述呢? 对于事物描述通常只关注两方面. 一个是属性,一个是行为. 3.成员变量和局部变量的区别: ①成 ...

  6. 浅谈NFC、RFID、红外、蓝牙的区别

    很多朋友对NFC和RFID这两个词感到陌生,但是手机经常会出现支持NFC支付,又没太在意,NFC与RFID其实是手机支付的种方式(手机支付也被称作移动支付,是一种允许移动用户使用其移动终端对所消费的商 ...

  7. 关于Unity中场景视图的使用

    1.在任何状态下,按下鼠标中键可以切换到手掌的那个状态,可以移动当前场景 2.在手掌的那个状态,按住鼠标左键是移动场景视图,右键是视角绕着摄像机移动,按住alt+鼠标左键,是绕着指定物体旋转视角 3. ...

  8. COUNT() 函数返回匹配指定条件的行数。

    SQL COUNT() 语法 SQL COUNT(column_name) 语法 COUNT(column_name) 函数返回指定列的值的数目(NULL 不计入): SELECT COUNT(col ...

  9. web 开发之nginx--- 阿里云部署nginx

    http://blog.csdn.net/zhangjingyangguang/article/details/7441268 http://www.cnblogs.com/languoliang/a ...

  10. 浅谈Spring(一)

    Spring 框架是一个分层架构,由 7 个定义良好的模块组成.Spring 模块构建在核心容器之上,核心容器定义了创建.配置和管理 bean 的方式. watermark/2/text/aHR0cD ...