ios7故事板项目不会移动 [英] ios7 storyboard items won't move

查看:91
本文介绍了ios7故事板项目不会移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的viewcontroller布局中移动故事板项目,但是在模拟器中运行时,它们不会让步。似乎他们坚持我放置它们的上方的橙色虚线。什么是橙色线条,为什么我不能移动我的物品?

I'm trying to move storyboard items in my viewcontroller layout, but the when ran in the simulator, they won't budge. It seems that they are sticking to the orange dotted lines above where I placed them. What are those orange lines and why can't I move my items?

以下是模拟器中的样子:

Here's what it looks like in the simulator:

推荐答案

那些橙色虚线表示视图的帧与它们的约束不匹配。

Those orange dotted lines show that the frames of the views don't match their constraints.

在这个例子中,我放置了一个标签,固定它的前导和顶部空间,然后移动标签。移动标签会改变它的框架,所以现在框架不符合前导和顶部空间约束。

In this example, I placed a label, pinned it's leading and top space, then moved the label. Moving the label changes it's frame, so now the frame doesn't agree with the leading and top space constraints.

请注意,在View Controller Scene旁边,现在有一个黄色警告图标。点击此图标即可显示:

Note that next to View Controller Scene, there's now a yellow warning icon. Clicking on this icon brings up this:

点击黄色三角形图标可以找到解决问题的几个选项。在这种情况下,由于我想将标签移动到新位置,我选择更新约束以使约束与新帧匹配。

Clicking on the yellow triangle icon gives a few options for fixing the problem. In this case, since I wanted to move the label to a new position, I choose Update Constraints to make the constraints match the new frame.

这篇关于ios7故事板项目不会移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆