質問

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