forkingdog / UITableView-FDTemplateLayoutCell

Template auto layout cell for automatically UITableViewCell height calculating
MIT License
9.93k stars 2.01k forks source link

ios10 以上 cell宽度警告 UITableViewCellContentView:0x7fa19ec34030.width == 375 #368

Open q858333 opened 6 years ago

q858333 commented 6 years ago

[LayoutConstraints] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. [ <NSLayoutConstraint:0x604000281900 UITableViewCellContentView:0x7fa19ec34030.width == 375>, <NSLayoutConstraint:0x60400028ca80 UITableViewCellContentView:0x7fa19ec34030.width == 0> ]

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x604000281900 UITableViewCellContentView:0x7fa19ec34030.width == 375>

kou8910 commented 6 years ago

0x7fa19ec34030.width == 375 0x7fa19ec34030.width == 0 不能共存 删除一个

Platycodon commented 6 years ago

在使用系统方法的时候,库给cell加了个宽约束屏幕宽,然后系统方法内部又给加了个0的宽度约束就冲突了,但是有些cell就不会,很迷

kou8910 commented 6 years ago

是不是代码与xib 混合使用了 xib有自己的约束 二者选其一

发自我的 iPhone

在 2018年4月26日,10:32,nan lu notifications@github.com 写道:

在使用系统方法的时候,库给cell加了个宽约束屏幕宽,然后系统方法内部又给加了个0的宽度约束就冲突了,但是有些cell就不会,很迷

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Platycodon commented 6 years ago

@kou8910 是用了xib,但是xib我自己并没有对cell做宽度约束。难道用这个库对xib支持不是很好=。=

kou8910 commented 6 years ago

这个xib的约束在你创建的时候就有了 你可以去右边属性栏 书页图标的那个模块下 把自动约束勾打掉 但是不建议 ! 这个库可以支持xib 前提是 创建的对象是用代码创建的才行

发自我的 iPhone

在 2018年4月27日,14:43,nan lu notifications@github.com 写道:

@kou8910 是用了xib,但是xib我自己并没有对cell做宽度约束。难道用这个库对xib支持不是很好=。=

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.