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

HarshilShah picture HarshilShah  路  3Comments

lucabartoletti picture lucabartoletti  路  3Comments

Przemyslaw-Wosko picture Przemyslaw-Wosko  路  3Comments

iwasrobbed picture iwasrobbed  路  3Comments

kleiberjp picture kleiberjp  路  3Comments