I’m trying to find a rational solution for a layout problem in iOS.
I need to load n images in a view with this layout:
-----------
| x x |
| x x |
| x x |
| x x |
| x x |
| x x |
-----------
Each image may have a different width, but the height has a maximum and each image is to be centered in it’s column.
What is the suggested approach?
I’m thinking of putting views with 50% width side by side and then center the images in them.
Thanks!
This should get you started. It does not, however, take into consideration the ratio of the images.
The above scaling assumes that the height of the grid location is always smaller than the width of the grid location.