【发布时间】:2016-01-04 22:41:24
【问题描述】:
我昨天刚开始学习自动布局,我很难理解这些约束。我认为我正在正确地进行自动布局,因为我的故事板显示自动布局和约束没有问题。我在所有设备中都得到了我想要的所有 UIImageViews。但是,当我构建时,在调试区域运行一个模拟器,我得到...
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.
(
"<NSLayoutConstraint:0x7fabb1d689f0 H:[UIImageView:0x7fabb1d68820(70)]>",
"<NSLayoutConstraint:0x7fabb1e983c0 UIImageView:0x7fabb1d68820.centerX == UIView:0x7fabb1d654c0.centerX - 265>",
"<NSLayoutConstraint:0x7fabb1e98460 UIImageView:0x7fabb1d68820.leading == UIView:0x7fabb1d654c0.leadingMargin - 20>",
"<NSLayoutConstraint:0x7fabb1e993c0 'UIView-Encapsulated-Layout- Width' H:[UIView:0x7fabb1d654c0(1024)]>"
)
我在调试区域收到上述消息。此外,当模拟器最终加载时,UIImageViews 都因某种原因而被拉伸。
【问题讨论】:
标签: ios xcode uiimageview autolayout size-classes