Tuesday, 15 June 2010

ios7 - iOS constraints: 4 Buttons -


I want to put 4 buttons on the screen. They all should have the same height and width. The difference between the buttons should be 35px and the limit for viewing the outer boundary should be 20px.

Now the button should be scaling in different sizes of the screen but with all the obstacles all my efforts have failed.

Does anyone know how to use them properly?

Layout:

  ----- ---------- | | | X x | | | | X x | | | ---------------  

have x buttons

If the result you want is given below, please follow the steps:

Always keep this method in mind, design your view in your storyboard (600x600) and then apply your barriers.

  • Select all buttons, then select" Equal width "and" Equal height "constraint in the following obstruction assistant: < / Li>

Enter image details here

Enter image details here

  • Repeat the previous step with B1 / B3 and B2 / B4, but select "vertical spacing".

  • For B1, it is bound to the left and upper boundaries presented below to 20px:

  • Before limiting constraints

    image here Enter details

    • B2 (top / right), B3 (left / bottom) and B4 (right / bottom)

    You are all set, your view will now properly scale, regardless of the screen size.


    No comments:

    Post a Comment