Fit View Swift

0

Hi, I'm finishing an application. The problem is that in 3.5 and 4 inches it looks good but in 4.7 and 5.5 it looks quite misadjusted the screen the objects were not centered and some appeared on posts in my storyboard add a View to order the screen and horizontally it looks good but horizontally it is not centered. My query is if there is any form or formula of Constraints to center or if I can do it by code. I already tested all the possible contraints and also the Reset to suggested option.

    
asked by Nicolas Rudisky 08.06.2016 в 23:54
source

1 answer

1

If you want to do it in the Storyboard, I would tell you to put those 4 icons in a UIView container, with the 4 views pinned between them and the margins of that container.

------------------------------------------
|  _______|______     ________|________  |
| |              |    |                | |
|-| Localización |----|   Turismo      |-|
| |______________|    |________________| |
| ________|______     ________|________  |
| |              |    |                | |
|_|    Clima     |----| Paso Hua Hum   |-|
| |______________|    |________________| |
|_________|___________________|__________|

and then to that container you put some constraints to center it horizontally. And another to put it at the height you want.

    
answered by 22.12.2016 / 16:07
source