问题
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