0

我几乎放弃了在今天的扩展中解决自动布局问题:-(。

我的 iOS 8 应用程序有一个简单的 Today 扩展,我想在其中显示一张二次照片和两个文本标签。

谢谢你的帮助。

在此处输入图像描述

这是我的实际布局。该视图在模拟器和我的真实 iPhone 上几乎显示正确,但我无法消除自动布局错误消息。

2015-01-09 21:12:31.099  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:0x7a379aa0 V:[UIButton:0x7a37a840'New Journal Entry'(38)]>",
"<NSLayoutConstraint:0x78f81680 UIButton:0x78f81310.width == 1.19111*UIButton:0x78f81310.height>",
"<NSLayoutConstraint:0x7a1846f0 UILabel:0x7a37c770'12. Oktober 2014 06:22'.leading == UIView:0x7a1743c0.leadingMargin + 10>",
"<NSLayoutConstraint:0x7a182580 V:[_UILayoutGuide:0x7a175960]-(8)-[UILabel:0x7a37c770'12. Oktober 2014 06:22']>",
"<NSLayoutConstraint:0x7a185400 UIView:0x7a1743c0.trailingMargin == UIButton:0x78f81310.trailing + 10>",
"<NSLayoutConstraint:0x7a17aff0 UIButton:0x78f81310.leading == UILabel:0x7a37c770'12. Oktober 2014 06:22'.leading>",
"<NSLayoutConstraint:0x7a17b020 UIButton:0x78f81310.top == UILabel:0x7a37c770'12. Oktober 2014 06:22'.top + 29>",
"<NSLayoutConstraint:0x7a17b9f0 V:[UIButton:0x78f81310]-(0)-[UIButton:0x7a37a840'New Journal Entry']>",
"<NSLayoutConstraint:0x7a17f780 V:[UIButton:0x7a37a840'New Journal Entry']-(0)-[_UILayoutGuide:0x7a17b690]>",
"<_UILayoutSupportConstraint:0x7a179c70 V:[_UILayoutGuide:0x7a175960(0)]>",
"<_UILayoutSupportConstraint:0x7a17ddf0 V:|-(0)-[_UILayoutGuide:0x7a175960]   (Names: '|':UIView:0x7a1743c0 )>",
"<_UILayoutSupportConstraint:0x7a17e0f0 V:[_UILayoutGuide:0x7a17b690(0)]>",
"<_UILayoutSupportConstraint:0x7a175000 _UILayoutGuide:0x7a17b690.bottom == UIView:0x7a1743c0.bottom>",
"<NSLayoutConstraint:0x78e4eee0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7a1743c0(273)]>",
"<NSLayoutConstraint:0x78e4eeb0 'UIView-Encapsulated-Layout-Height' V:    [UIView:0x7a1743c0(529)]>"
)

将尝试通过打破约束来恢复

4

1 回答 1

3

当涉及到今天扩展的自动布局时,Apple 方面存在一个错误。我的自动布局约束实际上为零,它已关闭,但我仍然得到“无法同时满足约束”。

于 2015-11-09T17:05:41.900 回答