我正在尝试实现一个简单的今天小部件,其中包含一个固定高度的单个标签.
在文档中它说:
如果窗口小部件具有要显示的其他内容,则可以依赖"自动布局"约束来适当调整窗口小部件的高度.
但是我一直得到"无法同时满足约束"的警告.
这是我尝试过的:

当我跑步时,我得到:
2014-09-18 21:13:07.123 TestWidget[23381:871330] 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 …Run Code Online (Sandbox Code Playgroud)