iOS   发布时间:2022-05-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – Autolayout约束警告“将尝试通过打破约束来恢复”大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我正在尝试实施新闻提要(不知何故像没有评论或喜欢的Instagram).它工作,但 xcode继续显示此错误.我尝试改变所有约束,然而,我无法开始工作. tableview的高度为475,图像的高度为400,带有标签的白色区域为75. 我确实用过 self.tableView.estimatedRowHeight = 475; self.tableView.rowHeight = UITableV
我正在尝试实施新闻提要(不知何故像没有评论或喜欢的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 – Autolayout约束警告“将尝试通过打破约束来恢复”全部内容,希望文章能够帮你解决ios – Autolayout约束警告“将尝试通过打破约束来恢复”所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。