I have several buttons and i want the lower one to placed in center Y plus 10-15 pixels. I am trying to do this with the auto layout constraints, but i can't figure out what should be the correct constraint.

有帮助吗?

解决方案

Add the Vertical Center in Container constraint (Alignment constraint button on the interface builder) to the buttons and change the constant to -10 to -15 as appropriate. You will probably need a x constraint, height constraint, and a width constraint as well.

其他提示

I don't think it's possible to place an item "N points above the center." Instead, you can create a plain UIView with a transparent background and center that in your window. Give it a height of 10 points or so. Then you can use auto layout to place your buttons ~5-10 points above that.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top