Iglistkit: Dynamic section height while keeping image aspect ratio

Created on 13 Feb 2017  路  1Comment  路  Source: Instagram/IGListKit

How would I size a full screen width section's height for a downloaded image and keep its aspect ratio correct?

question

Most helpful comment

@joecarey81 in Instagram the server sends the aspect ratio of the media as part of the JSON response. The we take the collectionContext.containerSize.width * aspectRatio to find the appropriate height. This makes calculating the size super cheap/efficient.

>All comments

@joecarey81 in Instagram the server sends the aspect ratio of the media as part of the JSON response. The we take the collectionContext.containerSize.width * aspectRatio to find the appropriate height. This makes calculating the size super cheap/efficient.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joseph-francis picture joseph-francis  路  3Comments

rnystrom picture rnystrom  路  3Comments

jessesquires picture jessesquires  路  3Comments

alexwillrock picture alexwillrock  路  3Comments

iwasrobbed picture iwasrobbed  路  3Comments