【发布时间】:2014-11-16 16:26:52
【问题描述】:
我正在使用 Xcode 6.1 (Beta) 构建一个针对 >iOS7 的应用程序。 我有一个原型单元,所有约束都在情节提要中完成。它在 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.
这是我的故事板相关的东西:
我为约束尝试了许多不同的方法,每次我告诉标签它从哪里开始(前导约束)和它在哪里结束(尾随...)时,它们都会崩溃。而且我不想给出明确的高度......
有什么想法吗?
【问题讨论】:
标签: ios objective-c xcode ios7 ios8