TableView框架更改-单元格布局错误?

时间:2019-06-19 15:08:13

标签: ios swift autolayout tableview

更改tableView的高度(约束)会导致无效的单元格布局。

在这种情况下,键盘的出现-消失会改变高度。


错误的视频:https://youtu.be/DOpyKzOUzdg

我不太了解,但是只有在我发送信息然后关闭键盘后才会发生。而且只会发生在第一个出现的单元格上。


更新1

所以看来这是由于某些约束冲突引起的

2019-06-19 21:30:59.206037+0200 PipeTest[80638:64224450] [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. 
(
    "id: , constant: 150.0",
    "id: , constant: 0.0",
    "id: , constant: 0.0",
    "id: , constant: 0.0",
    "id: , constant: 0.0",
    "id: , constant: 4.0",
    "id: , constant: 0.0",
    "id: , constant: 0.0",
    "id: UISV-canvas-connection, constant: 0.0",
    "id: UISV-canvas-connection, constant: 0.0",
    "id: UIView-bottomMargin-guide-constraint, constant: 8.0",
    "id: UIView-Encapsulated-Layout-Height, constant: 62.0",
    "id: UIView-topMargin-guide-constraint, constant: 8.0"
)

Will attempt to recover by breaking constraint 
id: , constant: 150.0

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

但是正如我之前提到的,只有在tableView正在转换时才会发生。

如果框架静止不动,就没有问题。

有人吗? :(

更新2

这是要求的单元格:

https://www.dropbox.com/s/nixjl9uygfxsj48/OwnChatMessageCell.xib?dl=0

更新3

(使聊天消息更简单,但仍会出现错误)

这是要求的屏幕截图:

enter image description here

0 个答案:

没有答案
相关问题