ios - How to AutoLayout the buttons in uiview controller in iphone? -
i have size of 4 inch , have added 4 icons in 3 different rows of equal size 60x60. can have proper view in iphone 4s,5,5s not in iphone 6 , 6 plus. how can apply auto layout , make icons bigger , of same ratio in iphone 6 , 6 plus. can made without coding?
like
this buttons should change size in iphone 6 , 6 plus i.e. should bigger , proper aligned. can possible without coding?
a simple example:
- drag button object library viewcontroller's view in storyboard
- ctrl drag button view (drag left or right) , choose center vertically in container
- ctrl drag button view (drag top or bottom) , choose center horizontally in container
- ctrl drag button button (yes, same button) , choose aspect ratio
- in size inspector check button's aspect ratio constraint have multiplier of 1:1
- ctrl drag button view (drag left or right) , choose equal widths
- in size inspector check button's equal width constraint have multiplier of 1:3 (or whatever value - 1:3 means that button's width 1 third of view's width)
that should it. luck! :)
Comments
Post a Comment