gpt4 book ai didi

ios - 自动布局约束警告 “Will attempt to recover by breaking constraint”

转载 作者:可可西里 更新时间:2023-11-01 04:15:28 25 4
gpt4 key购买 nike

我正在尝试实现新闻提要(有点像没有评论或喜欢的 instagram)。它有效,但 xcode 一直显示此错误。我尝试更改所有限制,但是,我无法开始工作。 tableview 的高度为 475,图像的高度为 400,为带有标签的白色区域留出 75。

我用过

self.tableView.estimatedRowHeight = 475;
self.tableView.rowHeight = UITableViewAutomaticDimension;

有什么帮助吗?

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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(

"<NSLayoutConstraint:0x174096530 UIImageView:0x1743e9000.top == UITableViewCellContentView:0x17418af80.topMargin + 13>",
"<NSLayoutConstraint:0x1740977f0 V:[PFImageView:0x1743e8e00]-(0)-| (Names: '|':UITableViewCellContentView:0x17418af80 )>",
"<NSLayoutConstraint:0x174097840 V:[UIImageView:0x1743e9000]-(24)-[PFImageView:0x1743e8e00]>",
"<NSLayoutConstraint:0x174097890 H:|-(0)-[PFImageView:0x1743e8e00] (Names: '|':UITableViewCellContentView:0x17418af80 )>",
"<NSLayoutConstraint:0x174097930 H:[PFImageView:0x1743e8e00]-(0)-| (Names: '|':UITableViewCellContentView:0x17418af80 )>",
"<NSLayoutConstraint:0x174097ac0 PFImageView:0x1743e8e00.width == PFImageView:0x1743e8e00.height>",
"<NSLayoutConstraint:0x174097b60 V:[UIImageView:0x1743e9000(30)]>",
"<NSLayoutConstraint:0x174092ed0 'UIView-Encapsulated-Layout-Width' H:[UITableViewCellContentView:0x17418af80(375)]>",
"<NSLayoutConstraint:0x174092f20 'UIView-Encapsulated-Layout-Height' V:[UITableViewCellContentView:0x17418af80(44)]>"
)


Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x174097b60 V:[UIImageView:0x1743e9000(30)]>

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

最佳答案

我实际上解决了将图像约束底部的优先级更改为 750 的问题。感谢您的帮助。

关于ios - 自动布局约束警告 “Will attempt to recover by breaking constraint”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28572319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com