Swift-无法同时满足约束条件
我试图在其他情节提要中进行操作,但我遇到了这个错误Swift-无法同时满足约束条件,swift,Swift,我试图在其他情节提要中进行操作,但我遇到了这个错误 2019-12-24 07:44:32.861248-0800 test[1588:142069] [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) lo
2019-12-24 07:44:32.861248-0800 test[1588:142069] [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:0x600003631e50 UIView:0x7fc09d715410.width == - 16 (active)>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600003631e50 UIView:0x7fc09d715410.width == - 16 (active)>
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.
斯威夫特
import UIKit
class AlertService {
func alert() -> AlertViewController {
let storyboard = UIStoryboard(name: "Alert", bundle: .main)
let alertVC = storyboard.instantiateViewController(identifier: "AlertVC") as! AlertViewController
return alertVC
}
}
我在Main.storyboard中添加了一个按钮,并在viewController中执行操作
let alertService = AlertService()
@IBAction func btn() {
let alertVC = alertService.alert()
present(alertVC, animated: true)
print("dsgjodig")
}
也许我不应该在视图中出现动作表所有动作表都这样做。这是苹果虫。它对应用程序的功能没有影响。忽略它,继续前进 所有的行动表都是这样做的。这是苹果虫。它对应用程序的功能没有影响。忽略它,继续前进 信息很清楚:
(1)查看每个约束,并尝试找出您不期望的约束;(2) 找到添加不需要的约束的代码并修复它。
请显示您的约束。@koen他们没有任何约束要显示,这是操作表的内置约束中的一个错误。是的,我没有任何约束,这只是一个具有上述代码和一些属性的新项目。信息很清楚:(1)查看每个约束,并尝试找出您不期望的约束;(2) 找到添加不需要的约束的代码并修复它。
请显示您的约束。@koen它们没有任何约束要显示,这是操作表的内置约束中的一个错误。是的,我没有任何约束,这只是一个具有上述代码和一些属性的新项目
let alertService = AlertService()
@IBAction func btn() {
let alertVC = alertService.alert()
present(alertVC, animated: true)
print("dsgjodig")
}