顶部约束不会自动布局得到较少 [英] Top constraint won't get less with auto-layout
问题描述
我试图让与我的故事板自动布局工作。我的第一个两个视图效果很好,在 UIViews
是在意见不调整,和刚刚获得通过的降低在顶部和底部约束。
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.
现在在我的第三种观点,我有一些问题。顶部约束不会得到更少。已经尝试过样3个小时,但还是不能由我自己看着办吧。难道我做错了什么?
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?
我已经试过:
- 挂钩右上角的UIView我的左上方的UIView
- 将我顶UIViews 的右侧或左侧和顶部约束
- 勾上UIViews到我的底部的UIView时,它的中心X
- 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
不过没有什么作品。
截图:
推荐答案
如果我得到它的权利 - (您想为中心的所有三个视图)。你可以把所有三个视图在一个父视图,您可以在中心垂直和水平设置宽度和高度约束然后对齐约束。
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.
这篇关于顶部约束不会自动布局得到较少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!