ios7 storyboard items won't move

别说谁变了你拦得住时间么 提交于 2019-12-12 19:14:18

问题


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:


回答1:


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.

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.



来源:https://stackoverflow.com/questions/19085869/ios7-storyboard-items-wont-move

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!