【发布时间】:2021-05-02 04:37:10
【问题描述】:
我有一个tableViewCell,我以编程方式对其进行约束。我只有一个 ImageView 在单元格内。现在我没有给单元格的contentView 一个固定的高度,而是给imageView 顶部的top 和bottom contentView 以便单元格高度随着imageView 高度的增加而增加。
messagingPersonProfilePicture.leadingAnchor.constraint(equalTo: self.leadingAnchor),
messagingPersonProfilePicture.topAnchor.constraint(equalTo: self.topAnchor, constant: 15),
messagingPersonProfilePicture.widthAnchor.constraint(equalToConstant: 50),
messagingPersonProfilePicture.heightAnchor.constraint(equalToConstant: 50),
messagingPersonProfilePicture.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -15),
现在,给定这些约束,程序正在打破这些约束,告诉我以下内容:
"<0x6000034a4e60 v:><0x6000034a4f00 uiimageview:0x7fa7f6605640.height="="><0x6000034a4f50 uiimageview:0x7fa7f6605640.bottom="=" paigham.messagestableviewcell:0x7fa7f7809c00><0x600003494000 paigham.messagestableviewcell:0x7fa7f7809c00>
<0x6000034a4f00 uiimageview:0x7fa7f6605640.height="=">0x6000034a4f00>0x600003494000>0x6000034a4f50>0x6000034a4f00>0x6000034a4e60>
>>>>
标签: ios swift uitableview constraints