swift - ui加载时自动布局

标签 swift uitableview

当我的 View 正在加载某些东西时会导致延迟并打印此错误 我不知道 请帮忙

2018-05-16 17:07:13.985160+0430 EligashtIOSApp[15125:2090232] [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:0x119492690 UIButton:0x11bcb9d60'\Ue634'.bottom == UIView:0x11b9be6f0.bottom + 50   (active)>",
    "<NSLayoutConstraint:0x11b952d50 UIButton:0x11bcb9d60'\Ue634'.bottom == UIView:0x11b9be6f0.bottom   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x119492690 UIButton:0x11bcb9d60''.bottom == UIView:0x11b9be6f0.bottom + 50   (active)>

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.

最佳答案

您有两个相互冲突的约束。你有一个约束说按钮应该距离 UIView 底部 50 px,还有一个约束说它应该距离同一 View 底部 0 px。这两个不能同时为真,因此您需要删除其中一个。

关于swift - ui加载时自动布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50371206/

相关文章:

ios - 应用程序切换期间 UITableView 分隔符闪烁

ios - 如何更改tableCell 的imageView 的frame?

swift - AVAssetExport 失败 "cannot decode"

ios - 尝试获取电话号码时不断获取 nil

ios - 在后台任务中添加到 CALayer 时不显示 UIImage

ios - Swift:PrepareForSegue,Swift Cast 失败

ios - 如何同时执行多个异步方法并在它们全部完成时获得回调?

ios - 为什么 CFStringEncodings 在 Swift 中没有 UTF8?

ios - UISearchController 方法没有被调用

ios - UITableView - 什么是 indexPath?