解决xib约束冲突
I would recommend to debug and find which constraint is "the one you don't want". Suppose you have following issue:

Always the problem is how to find following Constraints and Views.
There are two solutions how to do this:
- DEBUG VIEW HIERARCHY (Do not recommend this way)
Since you know where to find unexpected constraints (PBOUserWorkDayHeaderView) there is a way to do this fairly well. Lets find
UIViewandNSLayoutConstraintin red rectangles. Since we know their id in memory it is quite easy.- Stop app using Debug View Hierarchy:

- Find the proper UIView:

- The next is to find NSLayoutConstraint we care about:

As you can see, the memory pointers are the same. So we know what is going on now. Additionally you can find
NSLayoutConstraintin view hierarchy. Since it is selected in View, it selected in Navigator also.
If you need you may also print it on console using address pointer:
(lldb) po 0x17dce920
<UIView: 0x17dce920; frame = (10 30; 300 24.5); autoresize = RM+BM; layer = <CALayer: 0x17dce9b0>>
You can do the same for every constraint the debugger will point to you:-) Now you decide what to do with this.
PRINT IT BETTER (I really recommend this way, this is of Xcode 7)
- set unique identifier for every constraint in your view:

- create simple extension for
NSLayoutConstraint:
SWIFT:
extension NSLayoutConstraint {
override public var description: String {
let id = identifier ?? ""
return "id: \(id), constant: \(constant)" //you may print whatever you want here
}
}
OBJECTIVE-C
@interface NSLayoutConstraint (Description)
@end
@implementation NSLayoutConstraint (Description)
-(NSString *)description {
return [NSString stringWithFormat:@"id: %@, constant: %f", self.identifier, self.constant];
}
@end
- build it once again, and now you have more readable output for you:

- once you got your
idyou can simple tap it in your Find Navigator:

- and quickly find it:

解决xib约束冲突的更多相关文章
- ALTER SEQUENCE 修改序列解决唯一约束冲突 unique constraint violated
背景 自增序列会遇到也会遇到唯一约束冲突吗?是的,最常见的情况就是数据迁移之后,导致数据最大值超过序列值. 软件开发中不遇到些出乎意料的问题,总感觉不太够劲. 修改序列(ALTER SEQUENCE) ...
- 解决修改表结构,添加外键时出现“约束冲突”的错误
由于表结构更改,使用新建表,现有部分表需要更改外键,将引用更改到新建表的相应字段.在更改过程中,部分表出现如下错误提示: ALTER TABLE 语句与 COLUMN FOREIGN KEY 约束 ' ...
- Masonry控制台打印约束冲突问题解决
不知道你是不是视图的布局也是用的第三方Masonry,在使用中是不是也遇到了控制台约束冲突的警告打印,看下图: 从输出的信息可以知道,有的控件的约束明显重复了设置,所以指出了是哪个控件,重复设置了哪些 ...
- swift 第七课 xib 约束的优先级
前期要实现 一个自适应的label 的时候,就知到xib 约束是有优先级的,一直为深入研究: 乘写这个 博客的机会 ,试验下xib 约束的等级 …… 抱歉要查资料,在重新实践,先把主要浏览的网页 连接 ...
- Maven 解决JAR包冲突
在JAR 冲突的情况下, 利用Eclipse方式解决JAR包冲突时比较方便简洁的,步骤如下 1. 在Eclipse 中打开pom.xml , 选择 “Dependency Hierarchy” 2 ...
- sbt公布assembly解决jar包冲突 deduplicate: different file contents found in the following
一个.问题定义 近期使用sbt战斗assembly发生故障时,包,在package什么时候,发生jar包冲突/文件冲突,两个相同class来自不同jar包classpath内心冲突. 有关详细信息:我 ...
- 【Android Developers Training】 90. 序言:解决云储存冲突
注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...
- Android Studio 解决 Gradle 依赖冲突的问题
Android Studio 解决 Gradle 依赖冲突的问题 参考链接: Android Studio(Gradle)解决库依赖冲突问题:http://www.mobibrw.com/2016/3 ...
- git解决代码提交冲突
树冲突文件名修改造成的冲突,称为树冲突.比如,A同事把文件改名为A.C,B同事把同一个文件改名为B.C,那么B同事将这两个commit合并时,会产生冲突.如果最终确定用B同事的文件名,那么解决办法如下 ...
随机推荐
- USB协议[转]_基本上涵盖了所有最基础的USB协议相关知识。
背景: 需要使用到USB协议,我一直尝试着去强记这个流程,现在看来,其实不用.看多了,把这个过程具象出来,就牢牢记住了. 正文: 正文转自:http://fangjian0518.blog.163.c ...
- OOP感想
OOP是面向对象编程(Object Oriented Programming).集于一身,最终目的是各司其职,让每个职责的只关注自己那块,其他的不管丢给下一个人.比如说,一个页面,对于客户,只要能看到 ...
- 解压版MySQL安装说明
一.复制my.ini到MySQL解压的目录 例如:E:\MySQL 二.修改my.ini第39~40行 basedir = "E:\\MySQL" datadir = " ...
- 技术博客(初用markdown)
技术博客 菜鸟教程在这个网站我学到许多有趣的东西,并且弥补了我之前的一些不足之处. 以下为我学习到的内容. 1 如果想输出多个多位数的时候,可以尝试用多个if语句.如果需要输出3为数的时候,设置三个变 ...
- PYTHON 购物车程序
product_list = [ ('iphone',50000), ('Mac Pro',9900), ('Bike',8000), ('Watch',160000), ('Coffee',600) ...
- 2015安徽省赛 H.数7
http://xcacm.hfut.edu.cn/problem.php?id=1212 模拟大发 #include<iostream> #include<cstdio> #i ...
- java78_c
import java.util.*; public class Main { public static void main(String args[]){ Scanner cin=new Scan ...
- ubuntu安装文件比较工具Meld
Meld是一款可视化的文件及目录对比(diff) / 合并 (merge) 工具,通过它你可以对两个或三个文件/目录进行对比,并以图形化的方式显示出它们的不同之处,同时还提供编辑及合并功能,另外还支持 ...
- UIView的一些基本方法 init、loadView、viewDidLoad、viewDidUnload、dealloc
init方法 在init方法中实例化必要的对象(遵从LazyLoad思想) init方法中初始化ViewController本身 loadView方法 当view需要被展示而它却是nil时,view ...
- docker ui
docker run -d -p 9000:9000 --privileged -v /var/run/docker.sock:/var/run/docker.sock uifd/ui-for-doc ...