我无法满足今天 IOS 8 扩展中的限制
Posted
技术标签:
【中文标题】我无法满足今天 IOS 8 扩展中的限制【英文标题】:I am unable to satisfy the constraints in the IOS 8 today extension 【发布时间】:2015-01-09 20:21:30 【问题描述】:我几乎放弃了在今天的扩展中解决自动布局问题:-(。
我的 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)]>"
)
将尝试通过打破约束来恢复
【问题讨论】:
【参考方案1】:Apple 方面存在一个错误,即今天扩展的自动布局。我的自动布局约束实际上为零,它已关闭,但我仍然得到“无法同时满足约束”。
【讨论】:
以上是关于我无法满足今天 IOS 8 扩展中的限制的主要内容,如果未能解决你的问题,请参考以下文章
iOS 8 键盘扩展 - UIInputViewController 无法添加多个视图 [关闭]