swift - UIView-Encapsulated-Layout-Width 和 LayoutConstraint
问题描述
运行应用程序时出现以下错误。我有什么样的视觉问题?
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.
2019-06-15 17:45:15.916490+0300 ...[3888:779219] [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.
(
"<SnapKit.LayoutConstraint:0x280cf51a0@MainTableViewController.swift#3209 ....DeviceTableViewCell:0x10c82cc00.width == 375.0>",
"<NSLayoutConstraint:0x280be41e0 'UIView-Encapsulated-Layout-Width' ....DeviceTableViewCell:0x10c82cc00'cellId'.width == 0 (active)>"
)
Will attempt to recover by breaking constraint
<SnapKit.LayoutConstraint:0x280cf51a0@MainTableViewController.swift#3209 ...DeviceTableViewCell:0x10c82cc00.width == 375.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.
cell.snp.makeConstraints { (make) in
make.top.equalTo(100)
make.height.equalTo(205)
make.width.equalTo(view.frame.width)
}
解决方案
推荐阅读
- php - 当我尝试使用注释参数创建自定义消息时。我得到 [语法错误]
- python - 计算python中一个值相对于另一个值的重新出现次数
- node.js - 传递 get 参数来表达路由
- kubernetes - 以非管理权限在本地运行 Kubernetes,但缺少 kubernetes 配置文件
- java - 在 Kotlin/Android 中的 WebView 内搜索字符串
- python-3.x - Python-3.6:根据给定的列匹配比较 2 个大型未排序分隔文件
- swift - 如何使用 Swift 从表中的 HTML 类中检索标签
- java - 用于int数组的Java爆炸方法
- java - android studio:如何以编程方式更改同一 tablerow 上的相邻 TextView?
- git - git rebase 如何在合并之间工作?