小编kbt*_*bul的帖子

使用自动布局为iOS8今日扩展设置固定高度

我正在尝试实现一个简单的今天小部件,其中包含一个固定高度的单个标签.

在文档中它说:

如果窗口小部件具有要显示的其他内容,则可以依赖"自动布局"约束来适当调整窗口小部件的高度.

但是我一直得到"无法同时满足约束"的警告.

这是我尝试过的:

  1. 创建一个新的"今日扩展"目标,它创建一个带有"Hello World"标签和视图控制器的故事板.
  2. 将高度约束设置为"Hello World"标签.

在此输入图像描述

当我跑步时,我得到:

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)

ios autolayout ios8 today-extension

7
推荐指数
1
解决办法
1654
查看次数

标签 统计

autolayout ×1

ios ×1

ios8 ×1

today-extension ×1