项目中自定义Cell,控件使用autoLayout来设置约束,发现运行页面表现正常,但是控制台报如下错误:

  1. Unable to simultaneously satisfy constraints.
  2. Probably at least one of the constraints in the following list is one you don't want.
  3. Try this:
  4. () look at each constraint and try to figure out which you don't expect;
  5. () find the code that added the unwanted constraint or constraints and fix it.
  6. (
  7. <NSLayoutConstraint:0x10c30ee10 V:[UILabel:0x10c30ebb0'Label'(21.6667)]>,
  8. <NSLayoutConstraint:0x10c30f9c0 V:[UIView:0x10c30ea20()]>,
  9. <NSLayoutConstraint:0x10c30fab0 V:|-()-[UILabel:0x10c30ebb0'Label'] (Names: '|':UIView:0x10c30ea20 )>,
  10. <NSLayoutConstraint:0x10c30fb00 V:[UILabel:0x10c30ebb0'Label']-()-[UILabel:0x10c30f080'Label']>,
  11. <NSLayoutConstraint:0x10c30fb50 UILabel:0x10c30f080'Label'.height == UILabel:0x10c30ebb0'Label'.height>,
  12. <NSLayoutConstraint:0x10c30fc90 V:[UILabel:0x10c30f3d0'Label']-()-| (Names: '|':UIView:0x10c30ea20 )>,
  13. <NSLayoutConstraint:0x10c30fd80 V:[UILabel:0x10c30f080'Label']-()-[UILabel:0x10c30f3d0'Label']>
  14. )
  15.  
  16. Will attempt to recover by breaking constraint
  17. <NSLayoutConstraint:0x10c30ee10 V:[UILabel:0x10c30ebb0'Label'(21.6667)]>
  18.  
  19. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
  20. 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. SSH 限制

    SSH 限制 限制 SSH 连接 通过使用用户.组和拒绝/允许条目限制 SSH 用户连接您的主机.还可以针对各个主机使用 TCP Wrappers. 评论 David Tansley, 系统管理员, ...

  2. vue-tree

    vue-tree vue 编写的树形菜单,小巧实用,支持vue1.0,vue2.0 v1.0 功能: 1.支持多级树目录 2.支持高亮点击的节点 3.支持展开点击节点 4.支持点击收缩节点时收缩所有子 ...

  3. word字号

    1 大特号 63 2 特 号 54 3 初 号 42 4 小初号 36 5 大一号 31.5 6 一 号 28 7 小一号 24 8 二 号 21 9 小二号 18 10 三 号 16 11 小三号  ...

  4. HTML5 + AJAX ( jQuery版本 ) 文件上传带进度条

    页面技术:HTML5 + AJAX ( jQuery) 后台技术:Servlet 3.0 服务器:Tomcat 7.0 jQuery版本:1.9.1 Servlet 3.0 代码 package or ...

  5. list中存放map实例

    list中存放map实例 2016年08月08日 18:46:14 阅读数:22279 List中存放Map遍历输出的实例   import java.util.ArrayList;   import ...

  6. http://jadethao.iteye.com/blog/1926525

    http://jadethao.iteye.com/blog/1926525 ————————————————————————————————————————————————————————————— ...

  7. grid-tooltip扩展方法

    调用:$('#dg').datagrid('doCellTip', { 'max-width': '100px' }); /** * 扩展两个方法 */$.extend($.fn.datagrid.m ...

  8. JavaScript匿名类整理学习笔记

    以下为总结在开源的JavaScript框架中能看到很多这样语法结构(function(){})()比如我最近看的jQuery,及chediter.刚开始的时候我看到这样的结果有点奇怪,它是怎么执行的, ...

  9. 在Swing的组件中,基本上都是在AWT组件的名称前面加“J”

    在Swing的组件中,基本上都是在AWT组件的名称前面加“J”. 一般情况下,除了Choise等组件: import javax.swing.*;好要加上:import java.awt.*以及imp ...

  10. java------守护线程与非守护线程

    最近重新研究Java基础知识,发现以前太多知识知识略略带过了,比较说Java的线程机制,在Java中有两类线程:User Thread(用户线程).Daemon Thread(守护线程) ,(PS:以 ...