Vasu V
Vasu V

Reputation: 63

Storyboard Constraints in iOS

I am new to iOS and i want to set constraints to 3 buttons like following image.

First i want to set Background view (Green colour) = (0, 100, device width, 150);

then 3 buttons on the Background view (buttons are subviews of Background view).

Buttons height and width is fix i.e., 100 and 100.

Space between the buttons is 50 and buttons y position is 5

please help me to set constraints, the following image illustrate the Design. Thanks in advance enter image description here

Upvotes: 0

Views: 376

Answers (1)

JingJingTao
JingJingTao

Reputation: 1790

A bit tricky to explain, but I'll try, so select button2 and click the pin option and add the five constaints. enter image description here

The select button1, add the following constaints and repeat for button3. enter image description here

Finally you can align button2 to center horizontially.

enter image description here

Hope that helps, also read through the link Ulli posted, it's a good one, good luck.

Upvotes: 2

Related Questions