Top constraint won't get less with auto-layout

江枫思渺然 提交于 2019-12-24 12:34:25

问题


I'm trying to get to work with auto-layout in my storyboard. My first two views worked well, the UIViews that are in the views do not resize, and just get centered in my view by lowering the top and bottom constraint.

Now in my third view, I'm having some issues. The top constraint won't get less. Already tried like 3 hours but still cannot figure it out by myself. Am I doing something wrong?

I've already tried to:

  • Hook the right top UIView to my left top UIView
  • Insert an right or left and top constraint for my top UIViews
  • Hook the top UIViews to my bottom UIView when it's centered X

Still nothing works.

Screenshots:


回答1:


if i'm getting it right - (you want all three views to be centered). You can put all three views in one parent view and you can set width and height constraint then align constraints vertically and horizontally in center.



来源:https://stackoverflow.com/questions/24907935/top-constraint-wont-get-less-with-auto-layout

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