我正在创建一个单视图应用程序。
然后在故事板上,我将一个标签拖到页面的中间。然后在任何设备上将约束设置为中间
当我在iPhone retina 4英寸上运行时,它工作正常,当我在iPhone retina 3.5英寸上运行时,我得到以下错误
2014-09-03 11:02:35.136 Testing[3879:60b] 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:0x8e9b760 V:[_UILayoutGuide:0x8e876a0]-(253)-[UILabel:0x8e99cc0]>",
"<NSLayoutConstraint:0x8e9b790 V:[UILabel:0x8e99cc0]-(274)-[_UILayoutGuide:0x8e9b010]>",
"<_UILayoutSupportConstraint:0x8e9b410 V:[_UILayoutGuide:0x8e876a0(20)]>",
"<_UILayoutSupportConstraint:0x8e98f10 V:|-(0)-[_UILayoutGuide:0x8e876a0] (Names: '|':UIView:0x8e99ae0 )>",
"<_UILayoutSupportConstraint:0x8e97de0 V:[_UILayoutGuide:0x8e9b010(0)]>",
"<_UILayoutSupportConstraint:0x8e9b7c0 _UILayoutGuide:0x8e9b010.bottom == UIView:0x8e99ae0.bottom>",
"<NSAutoresizingMaskLayoutConstraint:0x8e9e2e0 h=--& v=--& V:[UIView:0x8e99ae0(480)]>")
请注意,约束的错误在顶部约束上。可能是因为酒吧吧。有什么帮助吗?
发布于 2014-09-03 17:37:11
好的,我自己解决。
只需要苹果视网膜英寸3.5的形状因子,而不是视网膜英寸4.0的形状因子。
https://stackoverflow.com/questions/25639298
复制相似问题