gpt4 book ai didi

ios - iOS 7 上的自动布局崩溃,在 iOS 8 上运行良好

转载 作者:行者123 更新时间:2023-12-01 16:38:59 24 4
gpt4 key购买 nike

我正在使用 Xcode 6.1 (Beta) 构建一个针对 >iOS7 的应用程序。
我有一个原型(prototype)单元,所有约束都在 Storyboard 中完成。它在 iOS8(iPhone 6 模拟器)上运行良好,当我在 iOS7(iPhone 5S 模拟器)上运行时,它崩溃并出现以下错误:

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:0x7f901848bf00 UILabel:0x7f90190cb410.trailing == UILabel:0x7f90190c8110.trailing>",
"<NSLayoutConstraint:0x7f901848bf50 H:[UILabel:0x7f90190cb410]-(19)-| (Names: '|':UITableViewCellContentView:0x7f9019076440 )>",
"<NSLayoutConstraint:0x7f901848bfa0 UILabel:0x7f90190cb410.leading == UILabel:0x7f90190c8110.leading>",
"<NSLayoutConstraint:0x7f9018490900 H:|-(15)-[UILabel:0x7f90190cb410] (Names: '|':UITableViewCellContentView:0x7f9019076440 )>",
"<NSAutoresizingMaskLayoutConstraint:0x7f90184a7800 h=--& v=--& H:[UITableViewCellContentView:0x7f9019076440(0)]>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7f901848bf00 UILabel:0x7f90190cb410.trailing == UILabel:0x7f90190c8110.trailing>

Break on objc_exception_throw to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

这是我的 Storyboard相关的东西:

enter image description here

enter image description here

我尝试了许多不同的约束方法,每次我告诉标签它从哪里开始(前导约束)和它在哪里结束(尾随...)时,它们都会崩溃。而且我不想给出明确的高度......

有任何想法吗?

最佳答案

对于可能发生冲突的 x 位置,您有两组约束。尝试删除将尾随和导致 super View 的偏移量对齐的约束对或尾随和导致字幕标签的约束。

关于ios - iOS 7 上的自动布局崩溃,在 iOS 8 上运行良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25978589/

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