gpt4 book ai didi

仅限模拟器中的 iOS 约束错误

转载 作者:行者123 更新时间:2023-11-28 19:48:57 24 4
gpt4 key购买 nike

我使用 Xcode Storyboard 设计了我的 iOS 应用程序 UI,现在一切看起来都很好,没有错误,没有警报。

当我在模拟器中运行我的应用程序时,我得到一个列表Unable to simultaneously satisfy constraints。这个列表非常模糊。

    "<NSLayoutConstraint:0x7b617600 UIButton:0x7b6112f0.width == UIButton:0x7b6112f0.height>",
"<NSLayoutConstraint:0x7b7abd20 UIButton:0x7b7a3180.centerY == UIButton:0x7b79d0f0.centerY>",
"<NSLayoutConstraint:0x7b7abd50 UIButton:0x7b7a3180.width == UIButton:0x7b6112f0.width>",
"<NSLayoutConstraint:0x7b7abd80 UIButton:0x7b7a3180.height == UIButton:0x7b6112f0.height>",
"<NSLayoutConstraint:0x7b7abdb0 UIButton:0x7b7a3180.centerX == UIButton:0x7b770ec0.centerX>",
"<NSLayoutConstraint:0x7b7abde0 V:[UIButton:0x7b7a3180]-(2)-[UIButton:0x7b770ec0]>",
"<NSLayoutConstraint:0x7b7abe30 H:|-(0)-[UIButton:0x7b770ec0] (Names: '|':UIView:0x7b7abbf0 )>",
"<NSLayoutConstraint:0x7b7abe60 UIButton:0x7b79d0f0.centerY == UIButton:0x7b78ff40.centerY>",
"<NSLayoutConstraint:0x7b7abec0 H:[UIButton:0x7b7a3180]-(NSSpace(8))-[UIButton:0x7b79d0f0](LTR)>",
"<NSLayoutConstraint:0x7b7abf20 UIButton:0x7b79d0f0.width == UIButton:0x7b6112f0.width>",
"<NSLayoutConstraint:0x7b7abf50 UIButton:0x7b6112f0.height == UIButton:0x7b770ec0.height>",
"<NSLayoutConstraint:0x7b7abf80 UIButton:0x7b6112f0.height == UIButton:0x7b78ff40.height>",
"<NSLayoutConstraint:0x7b7abfb0 UIButton:0x7b6112f0.centerY == UIButton:0x7b770ec0.centerY>",
"<NSLayoutConstraint:0x7b7abfe0 UIButton:0x7b6112f0.width == UIButton:0x7b78ff40.width>",
"<NSLayoutConstraint:0x7b7ac010 UIButton:0x7b6112f0.width == UIButton:0x7b770ec0.width>",
"<NSLayoutConstraint:0x7b7ac040 V:|-(2)-[UIButton:0x7b78ff40] (Names: '|':UIView:0x7b7abbf0 )>",
"<NSLayoutConstraint:0x7b7ac070 H:[UIButton:0x7b79d0f0]-(NSSpace(8))-[UIButton:0x7b78ff40](LTR)>",
"<NSLayoutConstraint:0x7b7ac0a0 H:[UIButton:0x7b78ff40]-(0)-|(LTR) (Names: '|':UIView:0x7b7abbf0 )>",
"<NSLayoutConstraint:0x7b7ac0d0 UIButton:0x7b60d210.height == UIButton:0x7b6112f0.height>",
"<NSLayoutConstraint:0x7b7ac100 UIButton:0x7b60d210.centerY == UIButton:0x7b6112f0.centerY>",
"<NSLayoutConstraint:0x7b7ac130 UIButton:0x7b60d210.bottom == UIView:0x7b7abbf0.bottom>",
"<NSLayoutConstraint:0x7b7ac390 V:[UIView:0x7b7abb60(<=190)]>",
"<NSLayoutConstraint:0x7b7ac3c0 H:[UIView:0x7b7abbf0]-(4)-|(LTR) (Names: '|':UIView:0x7b7abb60 )>",
"<NSLayoutConstraint:0x7b7ac420 UIView:0x7b7abb60.centerX == UIView:0x7b7abbf0.centerX>",
"<NSLayoutConstraint:0x7b7ac450 V:[UIView:0x7b7abbf0]-(>=2)-| (Names: '|':UIView:0x7b7abb60 )>",
"<NSLayoutConstraint:0x7b7ac4b0 UIView:0x7b7abb60.centerY == UIView:0x7b7abbf0.centerY>",
"<NSLayoutConstraint:0x7b7bce60 H:[UIView:0x7b7abb60]-(0)-|(LTR) (Names: '|':UIView:0x7b7a9640 )>",
"<NSLayoutConstraint:0x7b7bce90 H:|-(0)-[UIView:0x7b7abb60](LTR) (Names: '|':UIView:0x7b7a9640 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7bfa9e30 h=--& v=--& H:[UIView:0x7b7a9640(320)]>"

这是哪个按钮:UIButton:0x7b6112f0

这是哪个约束:NSLayoutConstraint:0x7b7bce90

在 Xcode Identity inspector 中,我找到了一个 Label 字段,我标记了我所有的按钮。但是当在模拟器中运行时,这些标签没有任何好处。

我如何从这个输出中识别对象?

最佳答案

您添加了过多的约束并复制了所需的内容。您应该避免添加重复的约束。

关于仅限模拟器中的 iOS 约束错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30317574/

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