Xcode 无法同时满足约束条件
Xcode is unable to simultaneously satisfy constraints
当我 运行 我正在开发的应用程序时,我在控制台中收到一条消息,上面写着
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)`
我只有一张背景图片,带有 height
、width
、trailing space
、leading space
、top space
和 [=17= 的约束条件].图像尺寸为 321 x 571、641 x 1137 和 960 x 1704。
我给你一个简单的建议:尝试删除所有约束并一次添加其中一些约束。
...但我怀疑问题可能出在单个图像的 height
、top space
和 bottom space
上:如果您的图像应该有高度,则不能同时尊重所有屏幕尺寸的 bottom 和 top space,没有为约束设置任何优先级。如果您属于这种情况,则至少需要删除其中的一个约束条件。
希望这对您有所帮助,否则请为您的问题添加更多信息。
当我 运行 我正在开发的应用程序时,我在控制台中收到一条消息,上面写着
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)`
我只有一张背景图片,带有 height
、width
、trailing space
、leading space
、top space
和 [=17= 的约束条件].图像尺寸为 321 x 571、641 x 1137 和 960 x 1704。
我给你一个简单的建议:尝试删除所有约束并一次添加其中一些约束。
...但我怀疑问题可能出在单个图像的 height
、top space
和 bottom space
上:如果您的图像应该有高度,则不能同时尊重所有屏幕尺寸的 bottom 和 top space,没有为约束设置任何优先级。如果您属于这种情况,则至少需要删除其中的一个约束条件。
希望这对您有所帮助,否则请为您的问题添加更多信息。